From 8db05ba411ecd3ce2cb0cb7c78fec87658e1a4ab Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 7 Mar 2006 19:06:50 +0000 Subject: Repair old performance bug in tuplesort.c/logtape.c. In the case where we are doing the final merge pass on-the-fly, and not writing the data back onto a 'tape', the number of free blocks in the tape set will become large, leading to a lot of time wasted in ltsReleaseBlock(). There is really no need to track the free blocks anymore in this state, so add a simple shutoff switch. Per report from Stefan Kaltenbrunner. --- src/include/utils/logtape.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/utils/logtape.h b/src/include/utils/logtape.h index 3791f03e9e3..7cd3db37774 100644 --- a/src/include/utils/logtape.h +++ b/src/include/utils/logtape.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/logtape.h,v 1.14 2006/03/05 15:59:07 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/logtape.h,v 1.15 2006/03/07 19:06:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -26,6 +26,7 @@ typedef struct LogicalTapeSet LogicalTapeSet; extern LogicalTapeSet *LogicalTapeSetCreate(int ntapes); extern void LogicalTapeSetClose(LogicalTapeSet *lts); +extern void LogicalTapeSetForgetFreeSpace(LogicalTapeSet *lts); extern size_t LogicalTapeRead(LogicalTapeSet *lts, int tapenum, void *ptr, size_t size); extern void LogicalTapeWrite(LogicalTapeSet *lts, int tapenum, -- cgit v1.2.3