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.
{
elog(DEBUG1, "all tuples processed, emptying buffers");
gistEmptyAllBuffers(&buildstate);
+ gistFreeBuildBuffers(buildstate.gfbb);
}
/* okay, all heap tuples are indexed */
* Create a temporary file to hold buffer pages that are swapped out of
* memory.
*/
- gfbb->pfile = BufFileCreateTemp(true);
+ gfbb->pfile = BufFileCreateTemp(false);
gfbb->nFileBlocks = 0;
/* Initialize free page management. */