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

ASF GitHub Bot commented on PHOENIX-6458:
-----------------------------------------

comnetwork edited a comment on pull request #1256:
URL: https://github.com/apache/phoenix/pull/1256#issuecomment-870392940


   @kadirozde @lhofhansl  FYI.
   
   1.You said "Phoenix client does not use a global index for the queries with 
the columns that are not covered by the global index" is not right , In 
QueryOptimizer.addPlan, if user specify a Index  Hint and there exists where 
clause, the sql would be rewritten as
   "SELECT /*+ NO_INDEX */ K,V1,V2 FROM T  WHERE ("K" IN ((SELECT /*+ INDEX(T 
IDX) */ ":K" FROM "IDX"  WHERE "0:V1" = 'bar')) AND V2 = 'foo') " , you may 
consider compatibility with exising code.
   
   2.Whether or not scaning the gobal index and  retrieving the corresponding 
rows from the data table is better than just scaning the data table is a 
complex problem, because there are many factors we need to  consider such as 
Network cost, random disk access cost , data distribution , column selective  
etc.  you said "It is expected that such performance improvement will happen 
when the index row key prefix length is greater than the data row key prefix 
length for a given query" is extremely insufficient.  Lack of a CBO framework 
in Phoenix, it is sensible to be conservative, I think it is better to left the 
choice to user by users specifying the Index Hint just as the existing code.
   
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> Using global indexes for queries with uncovered columns
> -------------------------------------------------------
>
>                 Key: PHOENIX-6458
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6458
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.1.0
>            Reporter: Kadir Ozdemir
>            Priority: Major
>         Attachments: PHOENIX-6458.master.001.patch
>
>
> Phoenix client does not use a global index for the queries with the columns 
> that are not covered by the global index. However, there are many cases where 
> using the global index to map secondary keys to primary keys and then 
> retrieving the corresponding rows from the data table results in faster 
> queries. It is expected that such performance improvement will happen when 
> the index row key prefix length is greater than the data row key prefix 
> length for a given query. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to