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

Himanshu Gwalani edited comment on PHOENIX-7304 at 4/13/24 7:49 AM:
--------------------------------------------------------------------

[~tkhurana] The idea is to use it for Hbase level scan (via MR jobs). For 
example, during migration of data from one cluster to another, if HBase level 
copy is done for all the tables, the copy operation will be issued for 
{_}IDX{_}<data-table>s and we would need the list of unique view index IDs to 
allow skip scan for such usecase.

If we do it for PTable#getIndexes - we would first have to get all the views on 
the table, and then for each view what all indexes are created. But if we 
directly list the view index IDs by queriying SYS.CAT with below phoenix query 
- it can directly list the required prefixes for enabling skip scan filter 
(view index IDs)

Phoenix Query: {{SELECT DISTINCT VIEW_INDEX_ID FROM SYSTEM.CATALOG WHERE 
TABLE_NAME IN (SELECT DISTINCT TABLE_NAME FROM SYSTEM.CATALOG WHERE LINK_TYPE = 
2 AND TENANT_ID IS NULL AND COLUMN_FAMILY = '<TABLE_NAME>') AND VIEW_INDEX_ID 
is not null;}}


was (Author: JIRAUSER300696):
[~tkhurana] The idea is to use it for Hbase level scan (via MR jobs). For 
example, during migration of data from one cluster to another, if HBase level 
copy is done for all the tables, the copy operation will be issued for 
_IDX_<data-table>s and we would need the list of unique view index IDs to allow 
skip scan for such usecase.

> 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