mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 00:42:54 +00:00
Add prefetch_enabled GUC to trigger Neon prefetch mechansim
This commit is contained in:
@@ -435,6 +435,14 @@ pg_init_libpagestore(void)
|
||||
GUC_UNIT_MB,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
DefineCustomBoolVariable("neon.prefetch",
|
||||
"Enable Neon prefetch mechanism",
|
||||
NULL,
|
||||
&prefetch_enabled,
|
||||
false,
|
||||
PGC_SIGHUP,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
relsize_hash_init();
|
||||
|
||||
if (page_server != NULL)
|
||||
|
||||
@@ -154,6 +154,7 @@ extern char *zenith_timeline;
|
||||
extern char *zenith_tenant;
|
||||
extern bool wal_redo;
|
||||
extern int32 max_cluster_size;
|
||||
extern bool prefetch_enabled;
|
||||
|
||||
extern const f_smgr *smgr_zenith(BackendId backend, RelFileNode rnode);
|
||||
extern void smgr_init_zenith(void);
|
||||
|
||||
@@ -98,6 +98,7 @@ char *page_server_connstring; // with substituted password
|
||||
char *zenith_timeline;
|
||||
char *zenith_tenant;
|
||||
bool wal_redo = false;
|
||||
bool prefetch_enabled;
|
||||
int32 max_cluster_size;
|
||||
|
||||
/* unlogged relation build states */
|
||||
@@ -1026,7 +1027,7 @@ zenith_prefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum)
|
||||
elog(ERROR, "unknown relpersistence '%c'", reln->smgr_relpersistence);
|
||||
}
|
||||
|
||||
if (n_prefetch_requests < MAX_PREFETCH_REQUESTS)
|
||||
if (prefetch_enabled && n_prefetch_requests < MAX_PREFETCH_REQUESTS)
|
||||
{
|
||||
prefetch_requests[n_prefetch_requests].rnode = reln->smgr_rnode.node;
|
||||
prefetch_requests[n_prefetch_requests].forkNum = forknum;
|
||||
|
||||
Reference in New Issue
Block a user