1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt was

not being consulted anywhere, so remove it and remove the _mdnblocks()
calls that were used to set it.  Change smgrextend interface to pass in
the target block number (ie, current file length) --- the caller always
knows this already, having already done smgrnblocks(), so it's silly to
do it over again inside mdextend.  Net result: extension of a file now
takes one lseek(SEEK_END) and a write(), not three lseeks and a write.
This commit is contained in:
Tom Lane
2001-05-10 20:38:49 +00:00
parent a26ad8a643
commit 642107d5ba
6 changed files with 129 additions and 106 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.54 2001/04/04 15:43:25 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.55 2001/05/10 20:38:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -569,7 +569,7 @@ read_info(char *caller, SeqTable elm, Buffer *buf)
sequence_magic *sm;
Form_pg_sequence seq;
if (RelationGetNumberOfBlocks(elm->rel) != 1)
if (elm->rel->rd_nblocks > 1)
elog(ERROR, "%s.%s: invalid number of blocks in sequence",
elm->name, caller);