1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Prevent synchronous scan during GIN index build, because GIN is optimized

for inserting tuples in increasing TID order.  It's not clear whether this
fully explains Ivan Sergio Borgonovo's complaint, but simple testing
confirms that a scan that doesn't start at block 0 can slow GIN build by
a factor of three or four.

Backpatch to 8.3.  Sync scan didn't exist before that.
This commit is contained in:
Tom Lane
2008-11-13 17:42:10 +00:00
parent 3379fae6de
commit 10e3acb8e7
6 changed files with 22 additions and 12 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.106 2008/10/17 23:50:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.107 2008/11/13 17:42:10 tgl Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -93,7 +93,7 @@ hashbuild(PG_FUNCTION_ARGS)
buildstate.indtuples = 0;
/* do the heap scan */
reltuples = IndexBuildHeapScan(heap, index, indexInfo,
reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
hashbuildCallback, (void *) &buildstate);
if (buildstate.spool)