From fdf6be80f993d2908f794c0a33aedff479a92813 Mon Sep 17 00:00:00 2001 From: "Vadim B. Mikheev" Date: Sun, 28 Mar 1999 20:32:42 +0000 Subject: 1. Vacuum is updated for MVCC. 2. Much faster btree tuples deletion in the case when first on page index tuple is deleted (no movement to the left page(s)). 3. Remember blkno of new root page in BTPageOpaque of left/right siblings when root page is splitted. --- src/backend/access/nbtree/nbtsearch.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/backend/access/nbtree/nbtsearch.c') diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c index 9d9cc0f9aa..593a5453bc 100644 --- a/src/backend/access/nbtree/nbtsearch.c +++ b/src/backend/access/nbtree/nbtsearch.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.41 1999/02/21 03:48:27 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.42 1999/03/28 20:31:58 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -706,15 +706,7 @@ _bt_next(IndexScanDesc scan, ScanDirection dir) so = (BTScanOpaque) scan->opaque; current = &(scan->currentItemData); - /* - * XXX 10 may 91: somewhere there's a bug in our management of the - * cached buffer for this scan. wei discovered it. the following is - * a workaround so he can work until i figure out what's going on. - */ - - if (!BufferIsValid(so->btso_curbuf)) - so->btso_curbuf = _bt_getbuf(rel, ItemPointerGetBlockNumber(current), - BT_READ); + Assert (BufferIsValid(so->btso_curbuf)); /* we still have the buffer pinned and locked */ buf = so->btso_curbuf; @@ -1069,7 +1061,11 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) rel = scan->relation; current = &(scan->currentItemData); - offnum = ItemPointerGetOffsetNumber(current); + /* + * Don't use ItemPointerGetOffsetNumber or you risk to get + * assertion due to ability of ip_posid to be equal 0. + */ + offnum = current->ip_posid; page = BufferGetPage(*bufP); opaque = (BTPageOpaque) PageGetSpecialPointer(page); so = (BTScanOpaque) scan->opaque; -- cgit v1.2.1