diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-05-15 14:14:49 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-05-15 14:14:49 +0000 |
commit | d0e1091cfd2f69c0b1056c7e14281299f70b5679 (patch) | |
tree | 873e28cf3a20810102e3d5ea09f5115800875d77 /src/backend/access/gist/gistget.c | |
parent | 3848a14ed7014bd6df0dfe8dedbeb545eb331e82 (diff) | |
download | postgresql-d0e1091cfd2f69c0b1056c7e14281299f70b5679.tar.gz |
we found a problem in GiST with massive insert/update operations
with many NULLs ( inserting of NULL into indexed field cause
ERROR: MemoryContextAlloc: invalid request size)
As a workaround 'vacuum analyze' could be used.
This patch resolves the problem, please upply to 7.1.1 sources and
current cvs tree.
Oleg Bartunov
Diffstat (limited to 'src/backend/access/gist/gistget.c')
-rw-r--r-- | src/backend/access/gist/gistget.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 8f3b5dd475..d6fac6f4e2 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -241,16 +241,16 @@ gistindex_keytest(IndexTuple tuple, 1, tupdesc, &isNull); - gistdentryinit(giststate, &de, (char *) datum, r, p, offset, - IndexTupleSize(tuple) - sizeof(IndexTupleData), - FALSE); - - if (isNull) + if (isNull || IndexTupleSize(tuple) == sizeof(IndexTupleData) ) { /* XXX eventually should check if SK_ISNULL */ return false; } + gistdentryinit(giststate, &de, (char *) datum, r, p, offset, + IndexTupleSize(tuple) - sizeof(IndexTupleData), + FALSE); + if (key[0].sk_flags & SK_COMMUTE) { test = FunctionCall3(&key[0].sk_func, @@ -266,6 +266,9 @@ gistindex_keytest(IndexTuple tuple, ObjectIdGetDatum(key[0].sk_procedure)); } + if ( (char*)de.pred != (char*)datum ) + if ( de.pred ) pfree( de.pred ); + if (DatumGetBool(test) == !!(key[0].sk_flags & SK_NEGATE)) return false; |