On Sat, 26 Mar 2005, Tom Lane wrote:

Oleg Bartunov <oleg@sai.msu.su> writes:
I'm looking for blocks *actually* read from disk, since IO is the most
important factor.

Well, you won't find that out from Postgres, since it has no idea whether a read() request was satisfied from kernel disk cache or had to actually go to disk.

so, what's the usefulness of pg_stat* ?

From my experiments I feel heap_blks_read is the table blocks read from disk,
well, sort of, and heap_blks_hit - from buffer. At least, I observed when I repeat the same query several times (heap_blks_read+heap_blks_hit) doesn't changed while more blocks come from heap_blks_hit.


You could turn on log_statement_stats to get some possibly-more-reliable numbers from the kernel via getrusage(), but this will only tell you about totals across the whole backend process, not per-relation ...


Hmm, it's impossible to do researching :( We have so many parameters and almost no reliable stats. How do you believe you did a good choice ? It's common in db worlds to have IO statistics (timings are not important) to research algorithms and implementation.

                        regards, tom lane


Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to