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

Lars Hofhansl commented on PHOENIX-6045:
----------------------------------------

Yeah, the comment is misguided or incomplete. The select it generates is:
{{SELECT "PKEY1","PKEY2",0."VAL1",0."VAL2" FROM TABLE1  WHERE VAL1 = 
'000000000000000'}}, and it won't use a global index unless all columns are 
covered. So we can't expect this work, server-side or not.

https://github.com/apache/phoenix/blob/4.x/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java#L538

If the index is on the server it picks the best plan, hence in the following it 
does not need to filter the plans. The plans considered for the best plan will 
not include any plans for global indexes with uncovered columns.

(In fact I think we do not need the distinction between mutable and immutable 
indexes any more. A while ago I consolidated all plan selection in the 
optimizer class, I simply forgot about the special logic for deletes that, I 
think, can be removed now.)

> Delete that should qualify for index path does not use index when multiple 
> indexes are available.
> -------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6045
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6045
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 4.15.0, 4.14.3
>            Reporter: Daniel Wong
>            Priority: Major
>             Fix For: 5.1.0, 4.16.0
>
>         Attachments: MultipleDeleteReproIT.java
>
>
> Delete that should qualify for index path does not use index when multiple 
> indexes are available.  Test case to reproduce will be below.



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

Reply via email to