mirror of https://github.com/citusdata/citus.git
ReleaseSysCache in logical_optimizer
parent
a82fa8831c
commit
186f632f88
|
@ -1510,9 +1510,9 @@ MasterAggregateExpression(Aggref *originalAggregate,
|
||||||
AggClauseCosts aggregateCosts;
|
AggClauseCosts aggregateCosts;
|
||||||
HeapTuple aggTuple;
|
HeapTuple aggTuple;
|
||||||
Form_pg_aggregate aggform;
|
Form_pg_aggregate aggform;
|
||||||
Oid combinefn;
|
Oid combine;
|
||||||
Oid serialfn = InvalidOid;
|
Oid serial = InvalidOid;
|
||||||
Oid deserialfn = InvalidOid;
|
Oid deserial = InvalidOid;
|
||||||
|
|
||||||
aggTuple = SearchSysCache1(AGGFNOID,
|
aggTuple = SearchSysCache1(AGGFNOID,
|
||||||
ObjectIdGetDatum(originalAggregate->aggfnoid));
|
ObjectIdGetDatum(originalAggregate->aggfnoid));
|
||||||
|
@ -1520,15 +1520,15 @@ MasterAggregateExpression(Aggref *originalAggregate,
|
||||||
elog(ERROR, "cache lookup failed for aggregate %u",
|
elog(ERROR, "cache lookup failed for aggregate %u",
|
||||||
originalAggregate->aggfnoid);
|
originalAggregate->aggfnoid);
|
||||||
aggform = (Form_pg_aggregate) GETSTRUCT(aggTuple);
|
aggform = (Form_pg_aggregate) GETSTRUCT(aggTuple);
|
||||||
|
combine = aggform->aggcombinefn;
|
||||||
|
if (IsValidOid(combine) && originalAggregate->aggtranstype == INTERNALOID) {
|
||||||
|
serial = aggform->aggserialfn;
|
||||||
|
deserial = aggform->aggdeserialfn;
|
||||||
|
}
|
||||||
|
ReleaseSysCache(aggTuple);
|
||||||
|
|
||||||
/* planner recorded transition state type in the Aggref itself */
|
if (IsValidOid(combine)) {
|
||||||
combinefn = aggform->aggcombinefn;
|
|
||||||
|
|
||||||
if (combinefn != InvalidOid) {
|
|
||||||
if (originalAggregate->aggtranstype == INTERNALOID) {
|
|
||||||
serialfn = aggform->aggserialfn;
|
|
||||||
deserialfn = aggform->aggdeserialfn;
|
|
||||||
}
|
|
||||||
} else if (aggregateType == AGGREGATE_COUNT && originalAggregate->aggdistinct &&
|
} else if (aggregateType == AGGREGATE_COUNT && originalAggregate->aggdistinct &&
|
||||||
CountDistinctErrorRate == DISABLE_DISTINCT_APPROXIMATION &&
|
CountDistinctErrorRate == DISABLE_DISTINCT_APPROXIMATION &&
|
||||||
walkerContext->pullDistinctColumns)
|
walkerContext->pullDistinctColumns)
|
||||||
|
|
Loading…
Reference in New Issue