From: | Tatsuo Ishii <ishii(at)postgresql(dot)org> |
---|---|
To: | tgl(at)sss(dot)pgh(dot)pa(dot)us |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Too many IO? |
Date: | 2012-03-14 23:01:05 |
Message-ID: | 20120315.080105.1915877889346697867.t-ishii@sraoss.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2012-03-15 00:09:08 | Re: pg_upgrade and statistics |
Previous Message | Fabrízio de Royes Mello | 2012-03-14 22:56:16 | Re: VALID UNTIL |