NABoolean AppliedStatMan::insertCachePredStatEntry( const CANodeIdSet & jbbcNodeSet, const EstLogPropSharedPtr& estLogProp) { CANodeIdSet * tableSet = new (STMTHEAP) CANodeIdSet (jbbcNodeSet); // FIXME!!! Must properly create cacheASM_ CANodeIdSet * result = cacheASM_-> insert(tableSet, estLogProp.get()); if (result == NULL) return FALSE; // insert failed. else return TRUE; // insert successful } // AppliedStatMan::insertCachePredStatEntry
COMPARE_RESULT EstLogProp::compareEstLogProp (const EstLogPropSharedPtr &other) const { if (this == other.get()) return SAME; // First thing that we may want to compare is the CANodeSets of the EstLogProp // if these are NOT NULL // This would work if Query Analizer created nodeSet_ for this and other if ((nodeSet_ != NULL) && (other->nodeSet_ != NULL)) { if ((*nodeSet_) == (*(other->nodeSet_))) return SAME; else return INCOMPATIBLE; } // This is the old logic after removing heuristic returning SAME for close // EstLogProp like resultCardinality_/other->resultCardinality in [0.8,1.2] // That heuristics was incompatible with Cascades assumption that in the case // when pruning is on we cannot have 2 different context for optimization // if their comparison returns SAME. if ( resultCardinality_ == other->resultCardinality_ AND ( // Check for the case where we have two "empty" input logical properties. ( columnStats_.entries() == 0 AND other->columnStats_.entries() == 0) OR ( columnStats_ == other->columnStats_ AND unresolvedPreds_ == other->unresolvedPreds_ AND inputForSemiTSJ_ == other->inputForSemiTSJ_ ) ) ) return SAME; return INCOMPATIBLE; }