Tags: gitqifan/gporca
Tags
Create LAS Correlated Apply only in Filter context (#500) In the case of SubqueryAll, we only want to create a Left Anti Semi Correlated Apply Not In when the subquery is in the filter context. For `value` context we are already create correlated apply using `FCreateCorrelatedApplyForExistOrQuant` The `CLogicalLeftAntiSemiCorrelatedApplyNotIn` transform eventually gives us the below expression. The project under `CLogicalLeftAntiSemiCorrelatedApplyNotIn` can only project `1` or `0` and not null, which is required by subquery in value context. ``` --CLogicalLeftAntiSemiCorrelatedApplyNotIn (Reqd Inner Cols: "b" (19)) |--CLogicalGbAgg( Global ) | |--CLogicalProject | | |--CLogicalLeftOuterApply | | | |--CLogicalGet "temp_a" | | | |--CLogicalProject | | | | |--CLogicalSelect | | | | | |--CLogicalSelect | | | | | | |--CLogicalGet "temp_b" | | | | | | +--CScalarCmp (>) | | | | | | |--CScalarIdent "a" | | | | | | +--CScalarIdent "c" | | | | | +--CScalarBooleanTest (Is Not False) | | | | | +--CScalarCmp (=) | | | | | |--CScalarIdent "b" | | | | | +--CScalarIdent "b" | | | | +--CScalarProjectList | | | | +--CScalarProjectElement "ColRef_0031" | | | | +--CScalarConst (1) | | | +--CScalarConst (1) | | +--CScalarProjectList | | +--CScalarProjectElement "ColRef_0033" | | +--CScalarIf | | |--CScalarNullTest | | | +--CScalarCmp (=) | | | |--CScalarIdent "b" (1) | | | +--CScalarIdent "b" (9) | | |--CScalarConst (1) | | +--CScalarConst (0) ```
Skip group expression containing circular references Consider the group expression CLogicalSelect [ 0 3 ] it has the 0th child coming from Group 0, where Group 0 has Duplicate Group 4 While deriving Stats, this will cause a circular loop as follows 1. CLogicalSelect child 0 -> Will ask the stats to be derived on Group 0 2. Group 0 will ask Group 4 to give the stats (as its duplicate), which will then again ask CLogicalSelect [0 4] to derive stats resulting in a loop. Such Group Expression can be ignored for deriving stats and implementation. ``` Group 4 (#GExprs: 5): 0: CLogicalSelect [ 0 3 ] 1: CLogicalNAryJoin [ 6 7 8 ] Origin: (xform: CXformInlineCTEConsumerUnderSelect, Grp: 4, GrpExpr: 0) 2: CLogicalCTEConsumer (0), Columns: ["a" (18), "b" (19), "a" (20), "b" (21)] [ ] 3: CLogicalNAryJoin [ 6 7 3 ] Origin: (xform: CXformInlineCTEConsumer, Grp: 4, GrpExpr: 2) 4: CLogicalInnerJoin [ 6 7 3 ] Origin: (xform: CXformExpandNAryJoinGreedy, Grp: 4, GrpExpr: 3) ``` ``` Group 0 (#GExprs: 0, Duplicate Group: 4): ``` Note: It only considers skipping group expression whose immediate child has the current group as its duplicate. Multi-level dependencies are not considered, and not sure if we have that issue.
Bump ORCA version to 3.51.0 This includes performance improvements for constraint derivation. Co-authored-by: Chris Hajas <[email protected]> Co-authored-by: Shreedhar Hardikar <[email protected]>
Fix costing of Bitmap TableScan (#492) This commit has three fixes to costing of Bitmap TableScan - When we get the colrefs for a Bitmap filter to decide whether it is on a single column, make sure outer refs are not included in it. - When one side of filter condition is an outer ref and we have an equals condition, then the NDV of filter is 1. - For multicolumn Bitmap TableScan, the initcost should be added only once and not for each of the rebinds. Co-authored-by: Bhuvnesh Chaudhary <[email protected]> Co-authored-by: Sambitesh Dash <[email protected]> Co-authored-by: Hans Zeller <[email protected]>
Skip CXformPushGbBelowSetOp when arity > threshold In case of queries containing a UNION over a large number of children, CXformPushGbBelowSetOp pushes the Group By op to each child, creating that many new groups in the memo. While not a problem by itself, it exponentially increases the number of bindings for other xforms that use CPatternTree to extract it. When extracting the bindings, each child of UNION can now be selected with and without the group by. The higher the number of such children, the more the number of possibilities, the higher the optimization time. An example of xform that is affected: CXformLeftSemiApply2LeftSemiJoin. To prevent this exponential increase in binding extraction, restrict when the CXformPushGbBelowSetOp may be executed by a configurable parameter.
Reduce colrefs by skipping unused ones (#480) Currently we retain all the colrefs of a table even though we only reference a few of them in the original query. This patch marks the colrefs as used if either its a system column or distribution or partitioning column or if it is referenced in the query and unused otherwise. When we derive the relational properties, we exclude the unused columns from the output columns list. For a SELECT COUNT(*) query on a 1600 column table which has a 10 way join, we see an improvement of approximately 40%. Co-authored-by: Abhijit Subramanya <[email protected]> Co-authored-by: Hans Zeller <[email protected]>
Add jobs to compile orca on ubuntu18.04 This commits adds jobs to the existing orca pipeline to compile xerces and orca, test the orca binary on ubuntu18.04 image. Also, adds the dependency on publish tag to check if ubuntu builds are successful. Co-authored-by: Bhuvnesh Chaudhary <[email protected]> Co-authored-by: Ashuka Xue <[email protected]>
PreviousNext