RE: explain plan, can you explain this?

  • From: "Allen, Brandon" <Brandon.Allen@xxxxxxxxxxx>
  • To: <yasin.baskan@xxxxxxxxxxxxxxxx>, <john.kanagaraj@xxxxxxxxx>, <dannorris@xxxxxxxxxxxxx>, "Oracle L" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 10 Jan 2008 09:18:47 -0700

SQL Stats are definitely reported as a delta in statspack reports.  I
think maybe the confusion is due the fact that the values reported by
spreport can be invalid for at least a couple different reasons:

1) The stat may only be reported at the _completion_ of the query, so
for example, if a query is running for 10 hours, that processing won't
be reported during any of the snapshots while the query was actually
running, and then, if you look at a 15 minute snapshot from before and
after the completion of the query, it will show 10 hours worth of
elapsed time for that query in a 15 minute window.  I think this effect
differs from version to version, depending on how frequently the stats
in v$sql are updated for a running query.

2) If a query is aged out of the pool, the stats from v$sql are reset,
so this can throw off the delta calculations and even make it negative,
e.g. at snapshot #100, query A has 1,000,000 buffer_gets, but at
snapshot #110, query A has been aged out of the pool and reloaded and
now shows only 1,000 buffer_gets, so when you run spreport from snapshot
100 to 110, you'll get 1,000-1,000,000=(-999,000) for this query.

Regards,
Brandon

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Yasin Baskan


John, are you sure that statspack reports sql statistics cumulatively?

Privileged/Confidential Information may be contained in this message or 
attachments hereto. Please advise immediately if you or your employer do not 
consent to Internet email for messages of this kind. Opinions, conclusions and 
other information in this message that do not relate to the official business 
of this company shall be understood as neither given nor endorsed by it.

--
//www.freelists.org/webpage/oracle-l


Other related posts: