mirror of https://github.com/citusdata/citus.git
Cache whether an object is in pg_dist_object. Avoids redundant lookups for non-distributed objects
parent
2a47cff7b7
commit
dd490b6376
|
@ -54,7 +54,7 @@ CallDistributedProcedureRemotely(CallStmt *callStmt, DestReceiver *dest)
|
|||
Oid functionId = funcExpr->funcid;
|
||||
|
||||
procedure = LookupDistObjectCacheEntry(ProcedureRelationId, functionId, 0);
|
||||
if (procedure == NULL)
|
||||
if (procedure == NULL || !procedure->isDistributed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ TryToDelegateFunctionCall(Query *query, bool *hasExternParam)
|
|||
|
||||
funcExpr = (FuncExpr *) targetEntry->expr;
|
||||
procedure = LookupDistObjectCacheEntry(ProcedureRelationId, funcExpr->funcid, 0);
|
||||
if (procedure == NULL)
|
||||
if (procedure == NULL || !procedure->isDistributed)
|
||||
{
|
||||
/* not a distributed function call */
|
||||
ereport(DEBUG4, (errmsg("function is not distributed")));
|
||||
|
|
|
@ -991,6 +991,7 @@ LookupDistObjectCacheEntry(Oid classid, Oid objid, int32 objsubid)
|
|||
isNullArray);
|
||||
|
||||
cacheEntry->isValid = true;
|
||||
cacheEntry->isDistributed = true;
|
||||
|
||||
cacheEntry->distributionArgIndex =
|
||||
DatumGetInt32(datumArray[Anum_pg_dist_object_distribution_argument_index -
|
||||
|
@ -1000,8 +1001,8 @@ LookupDistObjectCacheEntry(Oid classid, Oid objid, int32 objsubid)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* return NULL, cacheEntry left invalid in hash table */
|
||||
cacheEntry = NULL;
|
||||
cacheEntry->isValid = true;
|
||||
cacheEntry->isDistributed = false;
|
||||
}
|
||||
|
||||
systable_endscan(pgDistObjectScan);
|
||||
|
|
|
@ -110,6 +110,7 @@ typedef struct DistObjectCacheEntry
|
|||
DistObjectCacheEntryKey key;
|
||||
|
||||
bool isValid;
|
||||
bool isDistributed;
|
||||
|
||||
int distributionArgIndex;
|
||||
int colocationId;
|
||||
|
|
Loading…
Reference in New Issue