mirror of https://github.com/citusdata/citus.git
Enable push down only for reference table
parent
c08c1eb299
commit
cd9f6ae313
|
|
@ -2659,33 +2659,20 @@ hasPseudoconstantQuals(RelationRestrictionContext *relationRestrictionContext)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IsPushdownSafeForRTEInLeftJoin returns true if the given range table entry
|
* IsPushdownSafeForRTEInLeftJoin returns true if the given range table entry
|
||||||
* is safe for pushdown. Currently, we only allow RTE_RELATION and RTE_FUNCTION.
|
* is safe for pushdown. Currently, we only allow reference tables.
|
||||||
*/
|
*/
|
||||||
bool IsPushdownSafeForRTEInLeftJoin(RangeTblEntry *rte)
|
bool IsPushdownSafeForRTEInLeftJoin(RangeTblEntry *rte)
|
||||||
{
|
{
|
||||||
if (rte->rtekind == RTE_RELATION)
|
if (IsCitusTable(rte->relid) && IsCitusTableType(rte->relid, REFERENCE_TABLE))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/* check if it is a citus table, e.g., ref table */
|
|
||||||
else if (rte->rtekind == RTE_FUNCTION)
|
|
||||||
{
|
|
||||||
RangeTblEntry *newRte = NULL;
|
|
||||||
if(!ExtractCitusExtradataContainerRTE(rte, &newRte))
|
|
||||||
{
|
|
||||||
ereport(DEBUG5, (errmsg("RTE type %d is not safe for pushdown, function but it does not contain citus extradata",
|
|
||||||
rte->rtekind)));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ereport(DEBUG5, (errmsg("RTE type %d is not safe for pushdown",
|
ereport(DEBUG5, (errmsg("RTE type %d is not safe for pushdown",
|
||||||
rte->rtekind)));
|
rte->rtekind)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue