Needs Suggestion

Started by SUBHAM ROYalmost 15 years ago3 messagesgeneral
Jump to latest
#1SUBHAM ROY
subham.iem@gmail.com

My output of explain (analyze,buffers) is something like this:

shared hit=3796624 read=46038

So what is meant by *read* here? Does it indicates number of disk reads?

Does *shared hit* takes into account only the hit in the pg_buffercache of
the postgres or it also takes into account the *linux buffers* that postgres
uses?

--
Thank You,
Subham Roy,
CSE IIT Bombay.

#2Andreas Kretschmer
akretschmer@spamfence.net
In reply to: SUBHAM ROY (#1)
Re: Needs Suggestion

SUBHAM ROY <subham.iem@gmail.com> wrote:

My output of explain (analyze,buffers) is something like this:

shared hit=3796624 read=46038

So what is meant by read here? Does it indicates number of disk reads?

Does shared hit takes into account only the hit in the pg_buffercache of the
postgres or it also takes into account the linux buffers that postgres uses?

shared hit: read from shared mem
shared read: read from disk into shared mem

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082�, E 13.56889�

#3Guillaume Lelarge
guillaume@lelarge.info
In reply to: Andreas Kretschmer (#2)
Re: Needs Suggestion

On 05/04/2011 08:39 AM, Andreas Kretschmer wrote:

SUBHAM ROY <subham.iem@gmail.com> wrote:

My output of explain (analyze,buffers) is something like this:

shared hit=3796624 read=46038

So what is meant by read here? Does it indicates number of disk reads?

Does shared hit takes into account only the hit in the pg_buffercache of the
postgres or it also takes into account the linux buffers that postgres uses?

shared hit: read from shared mem
shared read: read from disk into shared mem

To be more precise:

shared hit

number of blocks directly read from PostgreSQL shared memory

read

number of blocks PostgreSQL asked the OS to give him (then the OS may
read the blocks from its own shared memory or may ask the disk
subsystem to give him (and then the disk subsystem may read it from
its own shared memory (SAN cache for example) or read it from the
disk))

To put it more simply:

shared hit:
number of blocks directly read from PostgreSQL shared memory

read:
number of blocks read outside of PostgreSQL shared memory (meaning it
may need disk read)

--
Guillaume
http://www.postgresql.fr
http://dalibo.com