phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ankit Singhal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3987) Do not read index when Select All in case of index scan.
Date Mon, 24 Jul 2017 15:08:00 GMT

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

Ankit Singhal commented on PHOENIX-3987:
----------------------------------------

Thanks [~mini666] for finding the root cause and the fix. 
some feedback(before I commit it):-

-- can you please write the test case in the LocalIndexIT (verifying explain plan and output).
-- Instead of matching the column_name(as "_SALT" is the valid column name for non-salted
tables), can you do like this(this is how it is currently handled elsewhere).
{code}
boolean isSalted = table.getBucketNum() != null;
for (int i = (isSalted ? 1 : 0) ; i <parentTableRef.getTable().getColumns().size(); i++)
{
PColumn column = parentTableRef.getTable().getColumns().get(i);
NODE_FACTORY.column(null, '"' + IndexUtil.getIndexColumnName(column) + '"', null).accept(visitor);
{code}



> Do not read index when Select All in case of index scan.
> --------------------------------------------------------
>
>                 Key: PHOENIX-3987
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3987
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.10.0
>            Reporter: JeongMin Ju
>            Priority: Minor
>         Attachments: PHOENIX-3987.patch
>
>
> I created table and local index, and then request select * query on index column.
> {noformat}
> create table test (
> rowkey not null primary key,
> column1 varchar,
> column2 varchar
> )
> salt_buckets=10
> ;
> create local index idx_test_column1 on test(column1);
> select * from test where column1 = 'xxxxxxx';
> {noformat}
> It is obvious that this query needs to scan the index.
> However, the query plan is a full scan.
> This is because the query rewrite for the Projected Table refers to the "Salt" column.
> For this reason, it should skip the salt column when rewriting the query.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message