amansinha100 commented on a change in pull request #1699: DRILL-7108: Improve selectivity estimates for (NOT)LIKE, NOT_EQUALS, IS NOT NULL predicates URL: https://github.com/apache/drill/pull/1699#discussion_r266514422
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdSelectivity.java ########## @@ -56,6 +56,7 @@ private static final DrillRelMdSelectivity INSTANCE = new DrillRelMdSelectivity(); static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillRelMdSelectivity.class); public static final RelMetadataProvider SOURCE = ReflectiveRelMetadataProvider.reflectiveSource(BuiltInMethod.SELECTIVITY.method, INSTANCE); + private static final double LIKE_PREDICATE_SELECTIVITY = 0.05; Review comment: It would be good to add some comment here for the justification. In particular, this is treating all LIKE predicates the same whether or not there is a leading wildcard or not. If in the future we want to refine this using an intelligent algorithm, you can mention it as a TODO here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
