This discussion is archived
6 Replies Latest reply: Jan 8, 2013 8:23 PM by Catfive Lander RSS

Direct path reads

Catfive Lander Explorer
Currently Being Moderated
I have inherited some code which queries the number of db block gets and consistent gets from v$mystat (joined with v$statname).
It sums these two values and calls them 'logical reads' as an indication of how busy the session is.

Am I right in thinking that direct path reads won't be included in those statistics, though? So if a session is busy doing reports with lots of sorts and a high degree of parallelism, it might well be very busy, but be recorded as having performed very few 'logical reads', according to that code? Wouldn't I also have to add in "db block gets direct" to take account of those?

Database is 11.2.0.3.
  • 1. Re: Direct path reads
    jgarry Guru
    Currently Being Moderated
    Hmmmmm... aren't direct reads physical (from Oracle's point of view)?

    You might have to redefine "busy" to answer this.
  • 2. Re: Direct path reads
    Catfive Lander Explorer
    Currently Being Moderated
    You're right. What I meant to say was that this code carefully counts 'physical reads', then equally carefully counts 'block gets+consistent gets' as 'logical reads'... but still manages to completely ignore physical reads direct, and that therefore this would be a misleading way to measure the amount of work a session performed.

    Or is it?
  • 3. Re: Direct path reads
    SalmanQureshi Expert
    Currently Being Moderated
    Hi
    Here is definition of "db block gets direct".
    *Number of times a CURRENT block was requested bypassing the buffer cache (for example, a direct load operation). This is a subset of "db block gets" statistics value.*

    Reference
    http://docs.oracle.com/cd/B28359_01/server.111/b28320/stats002.htm

    Salman
  • 4. Re: Direct path reads
    Catfive Lander Explorer
    Currently Being Moderated
    Ah. So that means the number of direct path reads is actually being counted after all. Interesting.. thanks for that.

    Added: except that I now see the emphasis on the word "current", and also the reference to a "direct load" operation. I am still left wondering whether a massively parallel query, or a large sort, or a LOB read would actually be counted by code that is adding the number of db block gets+consistent gets. Am stil confused. Sorry.
  • 5. Re: Direct path reads
    sb92075 Guru
    Currently Being Moderated
    Catfive Lander wrote:
    Ah. So that means the number of direct path reads is actually being counted after all. Interesting.. thanks for that.

    Added: except that I now see the emphasis on the word "current", and also the reference to a "direct load" operation. I am still left wondering whether a massively parallel query, or a large sort, or a LOB read would actually be counted by code that is adding the number of db block gets+consistent gets. Am stil confused. Sorry.
    consider doing your own controlled benchmark test to learn the answer firsthand.
  • 6. Re: Direct path reads
    Catfive Lander Explorer
    Currently Being Moderated
    Yup, I can certainly do that, but I thought the point of a forum where you could ask questions is that others may already know the answers.

    The "do a test and find out for yourself" response could pretty much be copied-and-pasted to every question ever asked here, couldn't it?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points