From 70f1482de3dd797eeee6093210c716115c38795b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 26 Nov 2005 03:03:07 +0000 Subject: Change seqscan logic so that we check visibility of all tuples on a page when we first read the page, rather than checking them one at a time. This allows us to take and release the buffer content lock just once per page, instead of once per tuple. Since it's a shared lock the contention penalty for holding the lock longer shouldn't be too bad. We can safely do this only when using an MVCC snapshot; else the assumption that visibility won't change over time is uncool. Therefore there are now two code paths depending on the snapshot type. I also made the same change in nodeBitmapHeapscan.c, where it can be done always because we only support MVCC snapshots for bitmap scans anyway. Also make some incidental cleanups in the APIs of these functions. Per a suggestion from Qingqing Zhou. --- src/include/nodes/execnodes.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/include/nodes/execnodes.h') diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index f70847798e6..82f182c3497 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.142 2005/11/25 19:47:50 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.143 2005/11/26 03:03:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -958,9 +958,6 @@ typedef struct BitmapIndexScanState * bitmapqualorig execution state for bitmapqualorig expressions * tbm bitmap obtained from child index scan(s) * tbmres current-page data - * curslot current tbmres index or tuple offset on page - * minslot lowest tbmres index or tuple offset to try - * maxslot highest tbmres index or tuple offset to try * ---------------- */ typedef struct BitmapHeapScanState @@ -969,9 +966,6 @@ typedef struct BitmapHeapScanState List *bitmapqualorig; TIDBitmap *tbm; TBMIterateResult *tbmres; - int curslot; - int minslot; - int maxslot; } BitmapHeapScanState; /* ---------------- -- cgit v1.2.3