Github user nonstop-qfchen commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/195#discussion_r46174709
--- Diff: core/sql/optimizer/ScanOptimizer.cpp ---
@@ -374,8 +399,21 @@ static NABoolean checkMDAMadditionalRestriction(const
ColumnOrderList& keyPredsB
}
}
- if(presentKeyColumns > noOfmissingKeyColumns) return TRUE;
- return FALSE;
+ switch ( strategy ) {
+ case MAJORITY_WITH_PREDICATES:
+ return (presentKeyColumns > noOfmissingKeyColumns);
--- End diff --
I agree and we are going to use the new strategy (total UEC) as the default
one.
Thanks
On Mon, Nov 30, 2015 at 11:23 AM, DaveBirdsall <[email protected]>
wrote:
> In core/sql/optimizer/ScanOptimizer.cpp
>
<https://github.com/apache/incubator-trafodion/pull/195#discussion_r46173600>
> :
>
> > @@ -374,8 +399,21 @@ static NABoolean
checkMDAMadditionalRestriction(const ColumnOrderList& keyPredsB
> >
> > }
> > }
> > - if(presentKeyColumns > noOfmissingKeyColumns) return TRUE;
> > - return FALSE;
> > + switch ( strategy ) {
> > + case MAJORITY_WITH_PREDICATES:
> > + return (presentKeyColumns > noOfmissingKeyColumns);
>
> I am not sure I see the point of this strategy. Suppose I have a 6 column
> key and a query with predicates on 4 columns. It makes a huge difference
> whether the predicates are on the leading columns (better) vs. the
trailing
> columns (worse). This heuristic does not take the column order into
account.
>
> â
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/incubator-trafodion/pull/195/files#r46173600>.
>
--
Regards, --Qifan
---
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.
---