Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit be02b16

Browse files
committed
Delete the temporary file used in buffered GiST build, after the build.
There were two bugs here: We forgot to call gistFreeBuildBuffers() function at the end of build, and we passed interXact == true to BufFileCreateTemp, so the file wasn't automatically cleaned up at end-of-transaction either.
1 parent 4317e02 commit be02b16

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/backend/access/gist/gistbuild.c

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ gistbuild(PG_FUNCTION_ARGS)
214214
{
215215
elog(DEBUG1, "all tuples processed, emptying buffers");
216216
gistEmptyAllBuffers(&buildstate);
217+
gistFreeBuildBuffers(buildstate.gfbb);
217218
}
218219

219220
/* okay, all heap tuples are indexed */

src/backend/access/gist/gistbuildbuffers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ gistInitBuildBuffers(int pagesPerBuffer, int levelStep, int maxLevel)
5858
* Create a temporary file to hold buffer pages that are swapped out of
5959
* memory.
6060
*/
61-
gfbb->pfile = BufFileCreateTemp(true);
61+
gfbb->pfile = BufFileCreateTemp(false);
6262
gfbb->nFileBlocks = 0;
6363

6464
/* Initialize free page management. */

0 commit comments

Comments
 (0)