Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2661

MDAM not chosen for OR predicate of leading index column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-incubating
    • None
    • sql-cmp
    • None

    Description

      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';

      Attachments

        Issue Links

          Activity

            People

              dbirdsall Dave Birdsall
              hzeller Hans Zeller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: