> Hello all,
>
> While digging the code I found out quite interesting comment in
> src/backend/access/heap/hio.c before function RelationPutHeapTupleAtEnd
>
> * Eventually, we should cache the number of blocks in a relation somewhere.
> * Until that time, this code will have to do an lseek to determine the number
> * of blocks in a relation.
>
> As far as I can see there's field rd_nblocks in Relation.
>
> Question: is this field properly updated? Could it be used instead of RelationGetNumberOfBlocks
> which calls lseek.
Probably should be kept up-to-date. Currently only vacuum sets it. It
would have to be kept up-to-date for every INSERT/UPDATE that adds a block.
-- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026