diff options
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r-- | src/backend/access/heap/heapam.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 7134581333a..c3a45b98db5 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.248 2008/01/14 01:39:09 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.249 2008/01/30 18:35:55 tgl Exp $ * * * INTERFACE ROUTINES @@ -59,6 +59,10 @@ #include "utils/syscache.h" +/* GUC variable */ +bool synchronize_seqscans = true; + + static HeapScanDesc heap_beginscan_internal(Relation relation, Snapshot snapshot, int nkeys, ScanKey key, @@ -104,7 +108,8 @@ initscan(HeapScanDesc scan, ScanKey key) * the thresholds for these features could be different, we make them the * same so that there are only two behaviors to tune rather than four. * (However, some callers need to be able to disable one or both of - * these behaviors, independently of the size of the table.) + * these behaviors, independently of the size of the table; also there + * is a GUC variable that can disable synchronized scanning.) * * During a rescan, don't make a new strategy object if we don't have to. */ @@ -129,7 +134,7 @@ initscan(HeapScanDesc scan, ScanKey key) scan->rs_strategy = NULL; } - if (allow_sync) + if (allow_sync && synchronize_seqscans) { scan->rs_syncscan = true; scan->rs_startblock = ss_get_location(scan->rs_rd, scan->rs_nblocks); |