[jira] [Comment Edited] (PHOENIX-6647) A local index should not be chosen for a full scan if that scan is not covered by the index.

2022-02-09 Thread Lars Hofhansl (Jira)


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

Lars Hofhansl edited comment on PHOENIX-6647 at 2/10/22, 5:03 AM:
--

Ah. Can't help it. Here's a change that fixes it for me.

Something like. Other heuristics with server merge are also possible.


was (Author: lhofhansl):
Ah. Can't help it. Here's a change that fixes it for me.

> A local index should not be chosen for a full scan if that scan is not 
> covered by the index.
> 
>
> Key: PHOENIX-6647
> URL: https://issues.apache.org/jira/browse/PHOENIX-6647
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 5.1.2
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 6647-5.1.txt
>
>
> {code}
> > explain select * from lineitem;
> +-++-+
> | 
>  PLAN 
>   | EST_BYTES_READ | EST |
> +-++-+
> | CLIENT 103-CHUNK 17711182 ROWS 1059064693 BYTES PARALLEL 2-WAY ROUND ROBIN 
> RANGE SCAN OVER LINEITEM [1]  
>| 1059064693 | 177 |
> | SERVER MERGE [0.PARTKEY, 0.SUPPKEY, 0.QUANTITY, 0.EXTENDEDPRICE, 
> 0.DISCOUNT, 0.TAX, 0.RETURNFLAG, 0.LINESTATUS, 0.COMMITDATE, 0.RECEIPTDATE, 
> 0.SHIPINSTRUCT, 0.SHIPMODE, 0.COMMENT] | 1059064693 | 177 |
> | SERVER FILTER BY FIRST KEY ONLY 
>   
>   | 1059064693 | 177 |
> +-++-+
> 3 rows selected (0.056 seconds)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Comment Edited] (PHOENIX-6647) A local index should not be chosen for a full scan if that scan is not covered by the index.

2022-02-09 Thread Lars Hofhansl (Jira)


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

Lars Hofhansl edited comment on PHOENIX-6647 at 2/9/22, 10:32 PM:
--

I do have the cost based optimizer enabled, which I think we haven't maintained 
a lot.

So the fix is to take the cost of merging the main table into the cost 
calculation.


was (Author: lhofhansl):
I do have the cost based optimizer enabled, which I think we haven't maintained 
a lot.

> A local index should not be chosen for a full scan if that scan is not 
> covered by the index.
> 
>
> Key: PHOENIX-6647
> URL: https://issues.apache.org/jira/browse/PHOENIX-6647
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 5.1.2
>Reporter: Lars Hofhansl
>Priority: Major
>
> {code}
> > explain select * from lineitem;
> +-++-+
> | 
>  PLAN 
>   | EST_BYTES_READ | EST |
> +-++-+
> | CLIENT 103-CHUNK 17711182 ROWS 1059064693 BYTES PARALLEL 2-WAY ROUND ROBIN 
> RANGE SCAN OVER LINEITEM [1]  
>| 1059064693 | 177 |
> | SERVER MERGE [0.PARTKEY, 0.SUPPKEY, 0.QUANTITY, 0.EXTENDEDPRICE, 
> 0.DISCOUNT, 0.TAX, 0.RETURNFLAG, 0.LINESTATUS, 0.COMMITDATE, 0.RECEIPTDATE, 
> 0.SHIPINSTRUCT, 0.SHIPMODE, 0.COMMENT] | 1059064693 | 177 |
> | SERVER FILTER BY FIRST KEY ONLY 
>   
>   | 1059064693 | 177 |
> +-++-+
> 3 rows selected (0.056 seconds)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)