[ 
https://issues.apache.org/jira/browse/PHOENIX-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14279338#comment-14279338
 ] 

Maryann Xue commented on PHOENIX-1560:
--------------------------------------

That would be difficult for now. Since in this optimization we only perform 
rewrite to an IN-clause subquery, and the "distinct" is added by compilation of 
this new subquery by SubqueryRewriter. As an alternative, we can provide a 
quicker fix to PHOENIX-1589 within the context of subqueries by providing a 
hint to disable adding this distinct. Thus, for this optimization we can 
automatically add that hint for the rewritten query to avoid the distinct. 
Actually in this patch we have already added to hints "NO_INDEX and 
SKIP_SCAN_HASH_JOIN" for the rewritten query. What do you think?

> 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, 1560.v2.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)

Reply via email to