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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy