"Oleg Bartunov" <oleg(at)sai(dot)msu(dot)su> writes
> One mystery remains, why stats show heap_blks_read > 0 for indexed search
?
> select 1 from foo where id=5
> I did pg_stat_reset() before run query.
>
There is no clustered index in PG so far, so all the data item has to be
stay in the heap. In brief, the executor has to check the visibility of each
row in the heap pointed by the index. For performance consideration, if one
row is invisible("killed"), PG could remember its status it in the index
item identifier, so next time it just ignore it.
Regards,
Qingqing