From 642107d5baa06c21bc9d9a937e4710008e4826a9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 10 May 2001 20:38:49 +0000 Subject: 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. --- src/backend/commands/sequence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/sequence.c') diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index fac2fb30de2..f1dbbf6d251 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -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); -- cgit v1.2.3