* table_beginscan_sampling is an alternative entry point for setting up a * TableScanDesc for a TABLESAMPLE scan. As with bitmap scans, it's worth * using the same data structure although the behavior is rather different. * In addition to the options offered by table_beginscan_strat, this call * also allows control of whether page-mode visibility checking is used. */
| 1145 | * also allows control of whether page-mode visibility checking is used. |
| 1146 | */ |
| 1147 | static inline TableScanDesc |
| 1148 | table_beginscan_sampling(Relation rel, Snapshot snapshot, |
| 1149 | int nkeys, struct ScanKeyData *key, |
| 1150 | bool allow_strat, bool allow_sync, |
| 1151 | bool allow_pagemode) |
| 1152 | { |
| 1153 | uint32 flags = SO_TYPE_SAMPLESCAN; |
| 1154 | |
| 1155 | if (allow_strat) |
| 1156 | flags |= SO_ALLOW_STRAT; |
| 1157 | if (allow_sync) |
| 1158 | flags |= SO_ALLOW_SYNC; |
| 1159 | if (allow_pagemode) |
| 1160 | flags |= SO_ALLOW_PAGEMODE; |
| 1161 | |
| 1162 | return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags); |
| 1163 | } |
| 1164 | |
| 1165 | /* |
| 1166 | * table_beginscan_tid is an alternative entry point for setting up a |