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

Lars Hofhansl edited comment on PHOENIX-6045 at 7/27/20, 9:20 PM:
------------------------------------------------------------------

Sorry for my verbose thought process here. But actually here's an interesting 
question: For mutable tables, why does VAL2 need to be selected for the DELETE 
(as the code does)?

Couldn't the select also be just: {{SELECT "PKEY1","PKEY2" FROM TABLE1 WHERE 
VAL1 = '000000000000000'}}, then knowing the PK(s) from the index, delete the 
rows on the server? The server can read back the existing row and now has all 
the information to delete these other index entries. Perhaps the reading back 
is deemed to expensive...?

Right now it's forcing this on the client:
{code}
        // Project all non PK indexed columns so that we can do the proper 
index maintenance
        for (PTable index : table.getIndexes()) {
{code}

So I'd still stay, for how this is currently designed, it works correctly.
At the very least we should add some tests.


was (Author: lhofhansl):
Sorry for my verbose thought process here. But actually here's an interesting 
question: For mutable tables, why does VAL2 need to be selected for the DELETE 
(as the code does)?

Couldn't the select also be just: {{SELECT "PKEY1","PKEY2" FROM TABLE1 WHERE 
VAL1 = '000000000000000'}}, then knowing the PK(s) from the index, delete the 
rows on the server? The server can read back the existing row and now has all 
the information to delete these other index entries. Perhaps the reading back 
is deemed to expensive...?

Right now it's forcing this on the client:
{code}
        // Project all non PK indexed columns so that we can do the proper 
index maintenance
        for (PTable index : table.getIndexes()) {
{code}

So I'd still stay, for the how this is currently designed it works correctly.
At the very least we should add some tests.

> 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