diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2008-08-23 10:37:24 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2008-08-23 10:37:24 +0000 |
commit | 1dcf6fdf1bd7fb2501445fa2ebfa57e04273e848 (patch) | |
tree | a7b79bb7b7e4638c16031b1279a21d7881795e94 /src/include/access/gist_private.h | |
parent | 42d313f5463dfeae7292ee35537ab1b9afe2f03e (diff) | |
download | postgresql-1dcf6fdf1bd7fb2501445fa2ebfa57e04273e848.tar.gz postgresql-1dcf6fdf1bd7fb2501445fa2ebfa57e04273e848.zip |
Fix possible duplicate tuples while GiST scan. Now page is processed
at once and ItemPointers are collected in memory.
Remove tuple's killing by killtuple() if tuple was moved to another
page - it could produce unaceptable overhead.
Backpatch up to 8.1 because the bug was introduced by GiST's concurrency support.
Diffstat (limited to 'src/include/access/gist_private.h')
-rw-r--r-- | src/include/access/gist_private.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index 497ceb318ed..e366dcc53e7 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/gist_private.h,v 1.31 2008/06/19 00:46:05 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/access/gist_private.h,v 1.32 2008/08/23 10:37:24 teodor Exp $ * *------------------------------------------------------------------------- */ @@ -58,6 +58,12 @@ typedef struct GISTSTATE TupleDesc tupdesc; } GISTSTATE; +typedef struct ItemResult +{ + ItemPointerData iptr; + bool recheck; +} ItemResult; + /* * When we're doing a scan, we need to keep track of the parent stack * for the marked and current items. @@ -73,6 +79,13 @@ typedef struct GISTScanOpaqueData ItemPointerData curpos; Buffer markbuf; ItemPointerData markpos; + + ItemResult pageData[BLCKSZ/sizeof(IndexTupleData)]; + OffsetNumber nPageData; + OffsetNumber curPageData; + ItemResult markPageData[BLCKSZ/sizeof(IndexTupleData)]; + OffsetNumber markNPageData; + OffsetNumber markCurPageData; } GISTScanOpaqueData; typedef GISTScanOpaqueData *GISTScanOpaque; |