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

Tweak some MDAM-related heuristics

    XMLWordPrintableJSON

Details

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

    Description

      While debugging a plan choice issue on a customer query, two issues were noted with MDAM heuristics.

      1. When CQD FSO_TO_USE is set to '0', FileScanOptimizer::optimize attempts to perform logic similar to that in ScanOptimizer::getMdamStatus, checking the mdamFlag that is stored in the index descriptor. But the logic is not the same (the inevitable result of having two copies of something!); in the latter case the mdamFlag is ignored if CQD RANGESPEC_TRANSFORMATION is 'ON' while in the FileScanOptimizer::optimize logic no such additional check is made. Now, 'ON' is presently the default for RANGESPACE_TRANSFORMATION. So, we have the anomaly that using CQD FSO_TO_USE '0' to force consideration of MDAM might still not get MDAM because of a flag that we would ignore otherwise.
      2. The mdamFlag in the IndexDesc object is set by IndexDesc :: pruneMdam (optimizer/IndexDesc.cpp). There is heuristic logic there to guess whether MDAM will be useful for a given access path. The major purpose of this logic is index elimination: if we have several indexes, and some look like good choices for MDAM and others not, we eliminate the ones that are not. Only secondarily is this mdam flag later looked at by the scan optimizer, as described above in 1. The major purpose of this logic still seems reasonable, though the computation logic itself can be criticized for not considering the possibility of a parallel predicate on a leading "SALT" column, for example. But the computation involves a CQD, MDAM_SELECTION_DEFAULT, which is set to a low value by default. The customer query involved showed that the value used is too low; this flag ended up eliminating a favorable MDAM plan. The default was likely last determined in the predecessor product; given that the HBase engine has different execution dynamics this value needs to be recalibrated.

      Attachments

        1. MdamTests2.py.txt
          13 kB
          Dave Birdsall

        Issue Links

          Activity

            People

              dbirdsall Dave Birdsall
              dbirdsall Dave Birdsall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: