*** pgsql/src/backend/access/gin/gininsert.c 2008/11/13 17:42:18 1.11.2.1 --- pgsql/src/backend/access/gin/gininsert.c 2009/03/24 22:06:24 1.11.2.2 *************** *** 8,14 **** * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/access/gin/gininsert.c,v 1.11 2008/01/01 19:45:46 momjian Exp $ *------------------------------------------------------------------------- */ --- 8,14 ---- * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/access/gin/gininsert.c,v 1.11.2.1 2008/11/13 17:42:18 tgl Exp $ *------------------------------------------------------------------------- */ *************** ginBuildCallback(Relation index, HeapTup *** 238,244 **** buildstate->indtuples += ginHeapTupleBulkInsert(buildstate, *values, &htup->t_self); /* If we've maxed out our available memory, dump everything to the index */ ! if (buildstate->accum.allocatedMemory >= maintenance_work_mem * 1024L) { ItemPointerData *list; Datum entry; --- 238,246 ---- buildstate->indtuples += ginHeapTupleBulkInsert(buildstate, *values, &htup->t_self); /* If we've maxed out our available memory, dump everything to the index */ ! /* Also dump if the tree seems to be getting too unbalanced */ ! if (buildstate->accum.allocatedMemory >= maintenance_work_mem * 1024L || ! buildstate->accum.maxdepth > GIN_MAX_TREE_DEPTH) { ItemPointerData *list; Datum entry;