diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-05-10 20:38:49 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-05-10 20:38:49 +0000 |
commit | 642107d5baa06c21bc9d9a937e4710008e4826a9 (patch) | |
tree | 2d4cef5702ca144fb89c0e131b3fcbb598a9f3dc /src/backend/commands/sequence.c | |
parent | a26ad8a643d4ae44be16a773e19f7ae32df048ac (diff) | |
download | postgresql-642107d5baa06c21bc9d9a937e4710008e4826a9.tar.gz postgresql-642107d5baa06c21bc9d9a937e4710008e4826a9.zip |
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.
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r-- | src/backend/commands/sequence.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |