mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Get rid of rd_nblocks field in relcache entries. Turns out this was
costing us lots more to maintain than it was worth. On shared tables it was of exactly zero benefit because we couldn't trust it to be up to date. On temp tables it sometimes saved an lseek, but not often enough to be worth getting excited about. And the real problem was that we forced an lseek on every relcache flush in order to update the field. So all in all it seems best to lose the complexity.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.230 2004/05/08 00:34:49 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.231 2004/05/08 19:09:24 tgl Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -1702,12 +1702,8 @@ reindex_index(Oid indexId)
|
||||
*/
|
||||
DropRelationBuffers(iRel);
|
||||
|
||||
/* Now truncate the actual data and set blocks to zero */
|
||||
if (iRel->rd_smgr == NULL)
|
||||
iRel->rd_smgr = smgropen(iRel->rd_node);
|
||||
smgrtruncate(iRel->rd_smgr, 0);
|
||||
iRel->rd_nblocks = 0;
|
||||
iRel->rd_targblock = InvalidBlockNumber;
|
||||
/* Now truncate the actual data */
|
||||
RelationTruncate(iRel, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user