mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
Add a GUC variable "synchronize_seqscans" to allow clients to disable the new
synchronized-scanning behavior, and make pg_dump disable sync scans so that it will reliably preserve row ordering. Per recent discussions.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user