GitHub user DaveBirdsall opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/186

    [TRAFODION-1641] Fix MDAM costing bugs

    This set of changes is a partial fix to [TRAFODION-1641]. It does resolve 
the issue described in the JIRA (that is, the query now gets a better choice of 
MDAM plans), however as in many Optimizer changes, there are side effects that 
still remain to be fully evaluated. Follow-on work will address these if judged 
to be significant.
    
    JIRA 1641 describes two bugs. This set of changes fixes bug #1: MDAM 
costing now takes into account the cumulative cost of each key column 
materialized. This set of changes partially fixes bug #2: It removes a bit of 
code that set the stop column for all MDAM plans to the last column (which 
caused MDAM plans to always traverse all keys, which can be grossly 
inefficient).
    
    For queries not containing RangeSpec predicates with OR subtrees, these 
changes will allow MDAM to traverse a leading proper subset of columns, which 
often will be far more efficient. (For RangeSpec predicates containing OR 
subtrees, there is a heuristic in the code that presently causes all key 
columns to be traversed. This could be improved, and is part of the follow-on 
work.)
    
    A side effect of these changes is that the cost computed for MDAM plans of 
2 or more key columns will be somewhat higher (and much higher when traversing 
key columns with high UEC). This may cause MDAM to be chosen less often than 
previously.
    
    One example of this occurs in the regression test suites (seabase/TEST010): 
A single query there now chooses a full table scan instead of an index scan 
using MDAM. Not using MDAM is a good decision for this particular plan. I have 
not investigated, however, why a full table scan is chosen over a full index 
scan.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/DaveBirdsall/incubator-trafodion Traf1641

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/186.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #186
    
----
commit 3415443dee6e4e1074c22342222e683c21ff31eb
Author: Dave Birdsall <[email protected]>
Date:   2015-11-24T19:55:38Z

    [TRAFODION-1641] Fix MDAM costing bugs

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to