diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2010-02-11 14:29:50 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2010-02-11 14:29:50 +0000 |
commit | 5209c084a646018bf429e4a1800e76e7b8b548a7 (patch) | |
tree | c065623638186055ecac27ec34bf61842b9f66bd /src/backend/access/gin/gininsert.c | |
parent | 161d9d51b321f021d4231001ccc32988edfccda0 (diff) | |
download | postgresql-5209c084a646018bf429e4a1800e76e7b8b548a7.tar.gz postgresql-5209c084a646018bf429e4a1800e76e7b8b548a7.zip |
Generic implementation of red-black binary tree. It's planned to use in
several places, but for now only GIN uses it during index creation.
Using self-balanced tree greatly speeds up index creation in corner cases
with preordered data.
Diffstat (limited to 'src/backend/access/gin/gininsert.c')
-rw-r--r-- | src/backend/access/gin/gininsert.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c index 54ec6ead0d4..e2a5e8b0135 100644 --- a/src/backend/access/gin/gininsert.c +++ b/src/backend/access/gin/gininsert.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gin/gininsert.c,v 1.25 2010/01/02 16:57:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/gin/gininsert.c,v 1.26 2010/02/11 14:29:50 teodor Exp $ *------------------------------------------------------------------------- */ @@ -247,9 +247,7 @@ ginBuildCallback(Relation index, HeapTuple htup, Datum *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) + if (buildstate->accum.allocatedMemory >= maintenance_work_mem * 1024L) { ItemPointerData *list; Datum entry; |