Commit be02b168 authored by Heikki Linnakangas's avatar Heikki Linnakangas

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.
parent 4317e024
...@@ -214,6 +214,7 @@ gistbuild(PG_FUNCTION_ARGS) ...@@ -214,6 +214,7 @@ gistbuild(PG_FUNCTION_ARGS)
{ {
elog(DEBUG1, "all tuples processed, emptying buffers"); elog(DEBUG1, "all tuples processed, emptying buffers");
gistEmptyAllBuffers(&buildstate); gistEmptyAllBuffers(&buildstate);
gistFreeBuildBuffers(buildstate.gfbb);
} }
/* okay, all heap tuples are indexed */ /* okay, all heap tuples are indexed */
......
...@@ -58,7 +58,7 @@ gistInitBuildBuffers(int pagesPerBuffer, int levelStep, int maxLevel) ...@@ -58,7 +58,7 @@ gistInitBuildBuffers(int pagesPerBuffer, int levelStep, int maxLevel)
* Create a temporary file to hold buffer pages that are swapped out of * Create a temporary file to hold buffer pages that are swapped out of
* memory. * memory.
*/ */
gfbb->pfile = BufFileCreateTemp(true); gfbb->pfile = BufFileCreateTemp(false);
gfbb->nFileBlocks = 0; gfbb->nFileBlocks = 0;
/* Initialize free page management. */ /* Initialize free page management. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment