You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2016/05/31 18:02:13 UTC

[jira] [Created] (PHOENIX-2957) WhereOptimizer to provide an estimate of key selectivity for key filters containing bind variables

Maryann Xue created PHOENIX-2957:
------------------------------------

             Summary: WhereOptimizer to provide an estimate of key selectivity for key filters containing bind variables
                 Key: PHOENIX-2957
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2957
             Project: Phoenix
          Issue Type: Bug
            Reporter: Maryann Xue
            Priority: Minor


Calcite will not load values of bind parameters until execution. This will not affect the runtime efficiency even if the bind parameter appears in primary key related filters, since we support "dynamic filter" and thus can re-compile it into a SkipScanFilter whenever possible. But it does affect cost calculation at compile time in some way, so it's better for Phoenix to be able to provide an estimate of key selectivity if bind parameters appear in key filters.
 
For example, t has a primary key of (k0, k1):
"select * from t where k0 = ?"
"select * from t where k0 = 'xxx' and k1 < ?"
Given some filter estimate constants, like 0.1 for "=", 0.5 for "<" or ">", we can calculate an estimate of the entire filter selectivity using logic provided by WhereOptimizer.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)