GitHub user DaveBirdsall opened a pull request: https://github.com/apache/incubator-trafodion/pull/1258
[TRAFODION-2765] Change heuristics so MDAM is considered more often This change adds new heuristic code to ScanOptimizer::useSimpleFileScanOptimizer (optimizer/ScanOptimizer.cpp). The new code checks to see if a single subset scan uses all the key predicates in the query. If so, we don't bother to cost MDAM. But if not, we do consider MDAM. The old code contained some (probably unintended) odd heuristics. Given a salted table with keys A, B and C, and a query SELECT * FROM T WHERE A = 5 AND C = 20, the old code would consider MDAM for serial plans but not for parallel ones! This is because in the serial case, a single subset would be a full table scan (so it is quite reasonable to try MDAM), but in the parallel case, because the "_SALT_" column would be covered by an equality predicate, the single subset SearchKey would have equality predicates on a prefix of the key. It would assume that a single subset with equality on "_SALT_" and A was always better than considering MDAM to column C. However, if the UEC of B is low, and the UEC of C is high, using MDAM to column C can be quite efficient. The new heuristics will allow this possibility to be explored. You can merge this pull request into a Git repository by running: $ git pull https://github.com/DaveBirdsall/incubator-trafodion Trafodion2765 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafodion/pull/1258.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 #1258 ---- commit 3b71aeb6f26389f862536903ff4156d55fa3aca5 Author: Dave Birdsall <dbirds...@apache.org> Date: 2017-10-05T22:10:11Z [TRAFODION-2765] Change heuristics so MDAM is considered more often ---- ---