Caching number of blocks in relation to avoi lseek. - Mailing list pgsql-hackers

From Denis Perchine
Subject Caching number of blocks in relation to avoi lseek.
Date
Msg-id 00061223344201.07937@dyp
Whole thread Raw
Responses Re: Caching number of blocks in relation to avoi lseek.
List pgsql-hackers
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
anlseek 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.

-- 
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: ALTER TABLE DROP COLUMN
Next
From: Denis Perchine
Date:
Subject: Re: Patch for 'Not to stuff everything as files in a single directory, hash dirs'