You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2016/09/02 17:10:20 UTC

[jira] [Comment Edited] (PHOENIX-1367) VIEW derived from another VIEW doesn't use parent VIEW indexes

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

Thomas D'Silva edited comment on PHOENIX-1367 at 9/2/16 5:10 PM:
-----------------------------------------------------------------

While adding parent indexes to a view table we check to ensure that all the view constant columns are present in the index so that we can add the view where clause to the index. If we create an index on a view v1 and then create a child view v2 that has the same view constants as v1 we would not be able to use the index (since the index doesn't contain the view constant columns of v1). 
I added a check to see if the parent table of the index is a view and the column matches a view constant column of the parent view then we can use the index. When we add the view statement since this column is constant in the index it ends up being something like : WHERE 'xyz'='xyz'

Regarding your previous comment about having the getParentName() methods return the physicalName if the parentName is null for b/w compatibility. 
In addIndexesFromPhysicalTable I have the following check.

{code}
+        // a view on a table will not have a parent name but will have a physical table name (which is the parent)
+        String parentName = view.getParentName()!=null ? view.getParentName().getString() : view.getPhysicalName().getString();
{code}

Would I still need to change getParentName() ?


was (Author: tdsilva):
While adding parent indexes to a view table we check to ensure that all the view constant columns are present in the index so that we can add the view where clause to the index. If we create an index on a view v1 and then create a child view v2 that has the same view constants previously we would not be able to use the index (since the index doesn't contain the view constant columns of v1). So I added a check to see if the parent table of the index is a view and the column matches a view constant column in the parent index. 

Regarding your previous comment about having the getParentName() methods return the physicalName if the parentName is null for b/w compatibility.  In addIndexesFromPhysicalTable I have the following check.

{code}
+        // a view on a table will not have a parent name but will have a physical table name (which is the parent)
+        String parentName = view.getParentName()!=null ? view.getParentName().getString() : view.getPhysicalName().getString();
{code}

Would I still need to change getParentName() ?

> VIEW derived from another VIEW doesn't use parent VIEW indexes
> --------------------------------------------------------------
>
>                 Key: PHOENIX-1367
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1367
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Thomas D'Silva
>             Fix For: 4.9.0, 4.8.1
>
>         Attachments: PHOENIX-1369-4.x-HBase-0.98-v2.patch, PHOENIX-1369-4.x-HBase-0.98.patch, PHOENIX_1367.test.patch
>
>
> If a VIEW has an index and another VIEW is derived from it, the child view will not use the parent view's indexes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)