Hans Zeller created TRAFODION-2661:
--------------------------------------
Summary: MDAM not chosen for OR predicate of leading index column
Key: TRAFODION-2661
URL: https://issues.apache.org/jira/browse/TRAFODION-2661
Project: Apache Trafodion
Issue Type: Bug
Components: sql-cmp
Affects Versions: 2.0-incubating
Reporter: Hans Zeller
Assignee: David Wayne Birdsall
We saw the following issue in a customer scenario:
SELECT SUM(c)
from tbl2
where a in ('A','B')
AND b >= '8';
The table has a salted index on column a. That index has many more columns (13
in this case, including the salt column).
The plan we would expect is an MDAM plan with no predicate on _SALT_ and the OR
predicate on column a.
However, we get a full index scan (we can use an index-only scan in this case).
When we force an MDAM plan, we see a vastly higher cost (250,000 in our
example) than for the single subset plan (cost of 9 in our example).
Dave has already mentioned that this has to do with RangeSpecs. The following
workaround gives the MDAM plan for us:
cqd RANGESPEC_TRANSFORMATION 'off';
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)