Content-Length: 281089 | pFad | http://github.com/postgrespro/postgres/commit/be02b16826ec9789ed3cb06e4e7531c94e497118

CA Delete the temporary file used in buffered GiST build, after the build. · postgrespro/postgres@be02b16 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/be02b16826ec9789ed3cb06e4e7531c94e497118

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy