*/
if (tidstate->ss.ss_currentScanDesc == NULL)
tidstate->ss.ss_currentScanDesc =
- table_beginscan(tidstate->ss.ss_currentRelation,
- tidstate->ss.ps.state->es_snapshot,
- 0, NULL);
+ table_beginscan_tid(tidstate->ss.ss_currentRelation,
+ tidstate->ss.ps.state->es_snapshot);
scan = tidstate->ss.ss_currentScanDesc;
/*
ItemPointerCopy(tid, result);
snapshot = RegisterSnapshot(GetLatestSnapshot());
- scan = table_beginscan(rel, snapshot, 0, NULL);
+ scan = table_beginscan_tid(rel, snapshot);
table_tuple_get_latest_tid(scan, result);
table_endscan(scan);
UnregisterSnapshot(snapshot);
ItemPointerCopy(tid, result);
snapshot = RegisterSnapshot(GetLatestSnapshot());
- scan = table_beginscan(rel, snapshot, 0, NULL);
+ scan = table_beginscan_tid(rel, snapshot);
table_tuple_get_latest_tid(scan, result);
table_endscan(scan);
UnregisterSnapshot(snapshot);
SO_TYPE_SEQSCAN = 1 << 0,
SO_TYPE_BITMAPSCAN = 1 << 1,
SO_TYPE_SAMPLESCAN = 1 << 2,
- SO_TYPE_ANALYZE = 1 << 3,
+ SO_TYPE_TIDSCAN = 1 << 3,
+ SO_TYPE_ANALYZE = 1 << 4,
/* several of SO_ALLOW_* may be specified */
/* allow or disallow use of access strategy */
- SO_ALLOW_STRAT = 1 << 4,
+ SO_ALLOW_STRAT = 1 << 5,
/* report location to syncscan logic? */
- SO_ALLOW_SYNC = 1 << 5,
+ SO_ALLOW_SYNC = 1 << 6,
/* verify visibility page-at-a-time? */
- SO_ALLOW_PAGEMODE = 1 << 6,
+ SO_ALLOW_PAGEMODE = 1 << 7,
/* unregister snapshot at scan end? */
- SO_TEMP_SNAPSHOT = 1 << 7
+ SO_TEMP_SNAPSHOT = 1 << 8
} ScanOptions;
/*
return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
}
+/*
+ * table_beginscan_tid is an alternative entry point for setting up a
+ * TableScanDesc for a Tid scan. As with bitmap scans, it's worth using
+ * the same data structure although the behavior is rather different.
+ */
+static inline TableScanDesc
+table_beginscan_tid(Relation rel, Snapshot snapshot)
+{
+ uint32 flags = SO_TYPE_TIDSCAN;
+
+ return rel->rd_tableam->scan_begin(rel, snapshot, 0, NULL, NULL, flags);
+}
+
/*
* table_beginscan_analyze is an alternative entry point for setting up a
* TableScanDesc for an ANALYZE scan. As with bitmap scans, it's worth using