[
https://issues.apache.org/jira/browse/TRAFODION-2765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16193835#comment-16193835
]
ASF GitHub Bot commented on TRAFODION-2765:
-------------------------------------------
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 <[email protected]>
Date: 2017-10-05T22:10:11Z
[TRAFODION-2765] Change heuristics so MDAM is considered more often
----
> MDAM is not considered when sometimes it should be
> --------------------------------------------------
>
> Key: TRAFODION-2765
> URL: https://issues.apache.org/jira/browse/TRAFODION-2765
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-cmp
> Affects Versions: 2.3-incubating
> Environment: All
> Reporter: David Wayne Birdsall
> Assignee: David Wayne Birdsall
>
> The Optimizer has logic in method ScanOptimizer::useSimpleFileScanOptimizer
> that tries to determine scenarios where a single subset access will clearly
> be optimal, and in those scenarios does not consider MDAM. An example would
> be a query whose only key predicates are equality predicates on a leading
> subset of the key columns.
> However, the logic in ScanOptimizer::useSimpleFileScanOptimizer sometimes
> rules out considering MDAM when it would be beneficial to do so. An example
> is a query with equality predicates on the first two columns of the key, no
> predicates on the third, and equality on the fourth. When the UEC of the
> third column is small, MDAM is likely to be the more efficient plan and
> should be considered.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)