Re: Too many IO? - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Too many IO?
Date
Msg-id 20120315.080105.1915877889346697867.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: Too many IO?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>> As you can see, this query generated 1255+1250 = 2505 times block read
>> either from the buffer or the disk. In my understanding the query
>> accesses an index tuple, which will need access to root page and
>> several number of meta pages (I mean index pages they are not either
>> root or leaf pages) and 1 leaf page, then access 1 heap block. So I
>> expected total number of IO would be somewhat:
> 
>> 500 index leaf pages + 500 heap blocks = 1000
> 
> The way I count it, each probe will touch the root page, a level-2 inner
> page, a level-1 inner page, a leaf page, and a heap page, so five buffer
> touches per cycle, which is almost exactly what you've got.  Only the
> first two of those are very likely to benefit from caching from previous
> searches, so the fact that you got 1255 hits and not only 1000 is
> actually a bit better than expected.  Probably this query was not done
> from a standing start, and so some of the level-1 pages were already in
> buffer cache.

Thanks for the explanation. Now I understand that PostgreSQL works as
expected.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: VALID UNTIL
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade and statistics