[
https://issues.apache.org/jira/browse/PHOENIX-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maryann Xue updated PHOENIX-1560:
---------------------------------
Attachment: 1560.patch
Rewrite the query to a where-clause subquery when:
1) Global index is hinted
2) Some columns missing from global index
3) A where filter will be effective in the index table scan
GlobalIndexOptimizationIT shows what cases will kick off this optimization and
what will not.
This is currently one limitation: the optimization is not enabled for join
queries. This would require big changes to how query optimization is applied
for join queries, so I suggest opening a different JIRA entry to address this
issue.
> Join between global index and data table if INDEX hint used
> -----------------------------------------------------------
>
> Key: PHOENIX-1560
> URL: https://issues.apache.org/jira/browse/PHOENIX-1560
> Project: Phoenix
> Issue Type: Bug
> Reporter: James Taylor
> Assignee: Maryann Xue
> Attachments: 1560.patch
>
>
> We already have an INDEX hint, and we already have a mechanism to collect
> referenced columns in the data table that are not in the index table (used
> only for local indexes currently). Instead of not using the global index when
> a referenced data column is not found in the index, we should rewrite the
> query to join back to the data table when the INDEX hint is present. This is
> always possible, as we always have the data PK columns in the index table,
> and our join optimization would kick in as well.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)