PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/syncscan.h"
#include "miscadmin.h"
#include "storage/lwlock.h"
#include "storage/shmem.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | ss_scan_location_t |
struct | ss_lru_item_t |
struct | ss_scan_locations_t |
Macros | |
#define | SYNC_SCAN_NELEM 20 |
#define | SYNC_SCAN_REPORT_INTERVAL (128 * 1024 / BLCKSZ) |
#define | SizeOfScanLocations(N) (offsetof(ss_scan_locations_t, items) + (N) * sizeof(ss_lru_item_t)) |
Typedefs | |
typedef struct ss_scan_location_t | ss_scan_location_t |
typedef struct ss_lru_item_t | ss_lru_item_t |
typedef struct ss_scan_locations_t | ss_scan_locations_t |
Functions | |
static BlockNumber | ss_search (RelFileLocator relfilelocator, BlockNumber location, bool set) |
Size | SyncScanShmemSize (void) |
void | SyncScanShmemInit (void) |
BlockNumber | ss_get_location (Relation rel, BlockNumber relnblocks) |
void | ss_report_location (Relation rel, BlockNumber location) |
Variables | |
static ss_scan_locations_t * | scan_locations |
#define SizeOfScanLocations | ( | N | ) | (offsetof(ss_scan_locations_t, items) + (N) * sizeof(ss_lru_item_t)) |
Definition at line 111 of file syncscan.c.
#define SYNC_SCAN_NELEM 20 |
Definition at line 71 of file syncscan.c.
#define SYNC_SCAN_REPORT_INTERVAL (128 * 1024 / BLCKSZ) |
Definition at line 83 of file syncscan.c.
typedef struct ss_lru_item_t ss_lru_item_t |
typedef struct ss_scan_location_t ss_scan_location_t |
typedef struct ss_scan_locations_t ss_scan_locations_t |
BlockNumber ss_get_location | ( | Relation | rel, |
BlockNumber | relnblocks | ||
) |
Definition at line 254 of file syncscan.c.
References elog, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), RelationData::rd_locator, RelationGetRelationName, and ss_search().
Referenced by initscan(), and table_block_parallelscan_startblock_init().
void ss_report_location | ( | Relation | rel, |
BlockNumber | location | ||
) |
Definition at line 289 of file syncscan.c.
References elog, LOG, LW_EXCLUSIVE, LWLockConditionalAcquire(), LWLockRelease(), RelationData::rd_locator, RelationGetRelationName, ss_search(), and SYNC_SCAN_REPORT_INTERVAL.
Referenced by heapam_scan_sample_next_block(), heapgettup_advance_block(), and table_block_parallelscan_nextpage().
|
static |
Definition at line 191 of file syncscan.c.
References ss_scan_locations_t::head, ss_scan_location_t::location, ss_lru_item_t::location, ss_lru_item_t::next, ss_lru_item_t::prev, ss_scan_location_t::relfilelocator, RelFileLocatorEquals, scan_locations, and ss_scan_locations_t::tail.
Referenced by ss_get_location(), and ss_report_location().
void SyncScanShmemInit | ( | void | ) |
Definition at line 135 of file syncscan.c.
References Assert, RelFileLocator::dbOid, ss_scan_locations_t::head, i, InvalidBlockNumber, InvalidOid, InvalidRelFileNumber, IsUnderPostmaster, ss_scan_locations_t::items, ss_scan_location_t::location, ss_lru_item_t::location, ss_lru_item_t::next, ss_lru_item_t::prev, ss_scan_location_t::relfilelocator, RelFileLocator::relNumber, scan_locations, ShmemInitStruct(), SizeOfScanLocations, RelFileLocator::spcOid, SYNC_SCAN_NELEM, and ss_scan_locations_t::tail.
Referenced by CreateOrAttachShmemStructs().
Size SyncScanShmemSize | ( | void | ) |
Definition at line 126 of file syncscan.c.
References SizeOfScanLocations, and SYNC_SCAN_NELEM.
Referenced by CalculateShmemSize().
|
static |
Definition at line 115 of file syncscan.c.
Referenced by ss_search(), and SyncScanShmemInit().