58 bool trace_syncscan =
false;
71 #define SYNC_SCAN_NELEM 20 83 #define SYNC_SCAN_REPORT_INTERVAL (128 * 1024 / BLCKSZ) 111 #define SizeOfScanLocations(N) \ 112 (offsetof(ss_scan_locations_t, items) + (N) * sizeof(ss_lru_item_t)) 150 scan_locations->
head = &scan_locations->
items[0];
167 item->
prev = (i > 0) ?
168 (&scan_locations->
items[i - 1]) : NULL;
169 item->
next = (i < SYNC_SCAN_NELEM - 1) ?
170 (&scan_locations->
items[i + 1]) : NULL;
195 item = scan_locations->
head;
202 if (match || item->
next == NULL)
217 if (item != scan_locations->
head)
220 if (item == scan_locations->
tail)
230 scan_locations->
head = item;
267 if (startloc >= relnblocks)
270 #ifdef TRACE_SYNCSCAN 273 "SYNC_SCAN: start \"%s\" (size %u) at %u",
290 #ifdef TRACE_SYNCSCAN 293 if ((location % 1024) == 0)
295 "SYNC_SCAN: scanning \"%s\" at %u",
315 #ifdef TRACE_SYNCSCAN 316 else if (trace_syncscan)
318 "SYNC_SCAN: missed update for \"%s\" at %u",
Size SyncScanShmemSize(void)
ss_scan_location_t location
static BlockNumber ss_search(RelFileNode relfilenode, BlockNumber location, bool set)
void LWLockRelease(LWLock *lock)
struct ss_lru_item_t ss_lru_item_t
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
ss_lru_item_t items[FLEXIBLE_ARRAY_MEMBER]
bool LWLockConditionalAcquire(LWLock *lock, LWLockMode mode)
#define RelationGetRelationName(relation)
BlockNumber ss_get_location(Relation rel, BlockNumber relnblocks)
struct ss_scan_location_t ss_scan_location_t
#define Assert(condition)
void SyncScanShmemInit(void)
#define InvalidBlockNumber
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
struct ss_lru_item_t * next
void ss_report_location(Relation rel, BlockNumber location)
struct ss_scan_locations_t ss_scan_locations_t
#define SYNC_SCAN_REPORT_INTERVAL
static ss_scan_locations_t * scan_locations
struct ss_lru_item_t * prev
#define RelFileNodeEquals(node1, node2)
#define SizeOfScanLocations(N)