hot data precache modify pg_hot_data table

This commit is contained in:
peitingwei 2023-03-31 10:19:14 +08:00
parent 489321b453
commit c5204f547d
8 changed files with 26 additions and 10 deletions

View File

@ -265,7 +265,7 @@ IsSharedRelation(Oid relationId)
relationId == AuthMemMemRoleIndexId ||
relationId == DatabaseNameIndexId ||
relationId == DatabaseOidIndexId ||
relationId == HotDataDatnameRelnameIndexId ||
relationId == HotDataDatnameRelnameIndexIndexId ||
relationId == SharedDescriptionObjIndexId ||
relationId == SharedDependDependerIndexId ||
relationId == SharedDependReferenceIndexId ||

View File

@ -82,7 +82,11 @@ BitmapHeapNext(BitmapHeapScanState *node)
ParallelBitmapHeapState *pstate = node->pstate;
dsa_area *dsa = node->ss.ps.state->es_query_dsa;
preCacheIndexNode = ((BitmapIndexScanState *)((PlanState *)(node))->lefttree)->biss_ScanDesc->indexRelation->rd_node.relNode;
/* set preCacheIndexNode */
if (isPreCacheIndex)
{
preCacheIndexNode = ((BitmapIndexScanState *)((PlanState *)(node))->lefttree)->biss_ScanDesc->indexRelation->rd_node.relNode;
}
/*
* extract necessary information from index scan node

View File

@ -66,6 +66,12 @@ IndexOnlyNext(IndexOnlyScanState *node)
TupleTableSlot *slot;
ItemPointer tid;
/* set preCacheIndexNode */
if (isPreCacheIndex)
{
preCacheIndexNode = node->ioss_RelationDesc->rd_node.relNode;
}
/*
* extract necessary information from index scan node
*/

View File

@ -88,7 +88,10 @@ IndexNext(IndexScanState *node)
TupleTableSlot *slot;
/* set preCacheIndexNode */
preCacheIndexNode = node->iss_RelationDesc->rd_node.relNode;
if (isPreCacheIndex)
{
preCacheIndexNode = node->iss_RelationDesc->rd_node.relNode;
}
/*
* extract necessary information from index scan node

View File

@ -4521,7 +4521,10 @@ PostgresMain(int argc, char *argv[], bool PrivateConn,
{
isPreCacheIndex = true;
isPreCacheIndexDone = false;
preCacheIndexNode = 0;
exec_simple_query(query_string + strlen("precache index "));
preCacheIndexNode = 0;
isPreCacheIndexDone = false;
isPreCacheIndex = false;
}
else

View File

@ -476,13 +476,13 @@ static const struct cachedesc cacheinfo[] = {
},
4
},
{HotDataRelationId, /* HOTDATADATNAMERELNAME */
HotDataDatnameRelnameIndexId,
2,
{HotDataRelationId, /* HOTDATADATNAMERELNAMEINDEX */
HotDataDatnameRelnameIndexIndexId,
3,
{
Anum_pg_hot_data_datname,
Anum_pg_hot_data_relname,
0,
Anum_pg_hot_data_indexname,
0
},
4

View File

@ -73,8 +73,8 @@ CATALOG(pg_hot_data,4790,HotDataRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(
*/
typedef FormData_pg_hot_data *Form_pg_hot_data;
DECLARE_UNIQUE_INDEX(pg_hot_data_datname_relname_index, 4791, on pg_hot_data using btree(datname name_ops, relname name_ops));
#define HotDataDatnameRelnameIndexId 4791
DECLARE_UNIQUE_INDEX(pg_hot_data_datname_relname_index_index, 4791, on pg_hot_data using btree(datname name_ops, relname name_ops, indexname name_ops));
#define HotDataDatnameRelnameIndexIndexId 4791
extern void PrecacheHotData();

View File

@ -63,7 +63,7 @@ enum SysCacheIdentifier
FOREIGNSERVERNAME,
FOREIGNSERVEROID,
FOREIGNTABLEREL,
HOTDATADATNAMERELNAME,
HOTDATADATNAMERELNAMEINDEX,
INDEXRELID,
LANGNAME,
LANGOID,