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

Lars Hofhansl edited comment on PHOENIX-5096 at 1/10/19 11:13 PM:
------------------------------------------------------------------

Note that including pk columns into the index does not add them (as 
[~jamestaylor] pointed out, they are always included), but rather changes the 
order.

A local index key looks like this:
{{(INDEX_ID, C1, C2, ..., pk1, pk2, ...)}}

When we include the pks (say pk1 as an example) in the index the index key 
looks like this:
{{(INDEX_ID, pk1, C1, C2, ...,pk2, ...)}}

Then the index is no longer usable without also specifying pk1 in the query. 
And only now will Phoenix prune regions based on pk1.

Perhaps this is expected. It's just not what I had expected, and it seems more 
limiting than necessary.


was (Author: lhofhansl):
Note that including pk columns into the index does not add them (as 
[~jamestaylor] pointed out, they are always included), but rather changes the 
order.

A local index key looks like this:
{{(INDEX_ID, C1, C2, ..., pk1, pk2, ...)}}

When we include the pks (say pk1 as an example) in the index the index key 
looks like this:
{{(INDEX_ID, pk1, C1, C2, ...,pk2, ...)}}

Then the index is no longer usable without also specifying the pk columns in 
the query.

Perhaps this is expected. It's just not what I had expected, and it seems more 
limiting than necessary.

> Local index region pruning is not working as expected.
> ------------------------------------------------------
>
>                 Key: PHOENIX-5096
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5096
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Priority: Major
>
> The pruning of local indexes should do the following:
> * Use the local index
> * Reduce the number of regions based on filters on the table's primary key 
> (i.e. WHERE conditions including prefixes of the primary key)
> Instead it looks like in order for this to work the needed PK column need to 
> be included in the local index itself, changing the sort order of the local 
> index.
> I'll provide some examples in the comments.
> [~giacomotaylor], [~tdsilva], [~vincentpoon], [~elserj], [~gjacoby]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to