LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-90] Two queries in FarragoAutoCalcRuleTest consume 90% of the test time #780

Open dynamobi-build opened 12 years ago

dynamobi-build commented 12 years ago

[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.

dynamobi-build commented 12 years ago

[author="jvs", created="Fri, 28 Apr 2006 18:41:21 -0500 (GMT-05:00)"] Bumping up priority based on the fact that addition of every new optimizer rule makes this worse, to the point where we now have to disable the test due to addition of push-down filters. Recommended fix is to set up a custom planner which uses a circumscribed rule set.