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

Tanuj Khurana commented on PHOENIX-7304:
----------------------------------------

[~hgwalani81] Getting view index IDs for a physcial table doesn't seem very 
useful because all the view indexes share the same physical table. What you 
need is given a data table row (in this case  a view) which all indexes are 
present on that view. That information is already available  in the PTable 
object ({*}PTable#getIndexes(){*}) That will give you the Ptable of all the 
indexes that are created on this view and then you can call 
PTable#getViewIndexId() 

But if you want to build index table row keys you should create IndexMaintainer 
object from the data table PTable and index PTable and it will build the index 
row key for a given data table row key. See *IndexMaintainer#buildRowKey()*

> Add support for getting list of View Index IDs for any View Index Physical 
> Table
> --------------------------------------------------------------------------------
>
>                 Key: PHOENIX-7304
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7304
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: Himanshu Gwalani
>
> The first 2 bytes of any View Index row are reserved for view index Ids. If 
> there is an API to get list all existing unique view index IDs, client can 
> leverage it for different usecase
> Eg: If a client need to scan and filter view index table, based on the list 
> of data table keys, skip-scan filter cannot be directly leveraged since row 
> key is not the prefix of view index. Instead if a list of unique view index 
> IDs is already available, skip scan filter can be used with combination of 
> view index IDs and knonw keys of data table, which would ultimately improve 
> scan performance by avoiding a full table scan.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to