dynamobi/dynamobi — Issue #780: [FRG-90] Two queries in FarragoAutoCalcRuleTest consume 90% of the test time
Author: dynamobi-build
Created: 2011-12-30 03:48:38+00:00
State: open
Labels: FRG, Volcano Planner

[reporter="stephan", created="Wed, 22 Mar 2006 12:43:18 -0500 (GMT-05:00)"]
The queries in question are in farrago/testcases/autoCalcRule.sql:

explain plan for select cplus(jplus(deptno, 1), 2), jplus(cplus(deptno, 1), 2) f

rom sales.emps where cplus(jplus(deptno, 1), 2) = 100 or jplus(cplus(deptno, 1),

2) = 100;

explain plan for select jplus(cplus(deptno, 1), 2), cplus(jplus(deptno, 1), 2) f

rom sales.emps where cplus(jplus(deptno, 1), 2) = 100 or jplus(cplus(deptno, 1),

2) = 100;

The first of the two causes the FarragoAutoCalcRule to be invoked 900 times. The two queries together consume 90% of the test's run time.

Suspect that common subexpression elimination and the auto calc rule are at cross-purposes here. This doesn't normally happen in "real life" because the number of RexCalls that can only be implemented in one calc vs. the other is small.