You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/06/17 18:10:00 UTC

[jira] [Comment Edited] (PHOENIX-1505) Support defining a VIEW over multiple tables

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

Julian Hyde edited comment on PHOENIX-1505 at 6/17/17 6:09 PM:
---------------------------------------------------------------

The concept of a "view parents" can be simplified when we move to Calcite. A view either has a base table (in which case, it is DML-capable) or it does not. The parent is never a view.

Indexes on views should be at most syntactic sugar for functional indexes. For example,

{code}
create table t (a, b, c);
create table v as select a, b + c as d from t where e = 5;
create index iv on v(a, d);
create index it on t(a, b + c);
{code}

I would expect v and iv to have identical contents, and either could be used to answer the query {code}select a from t where b + c > 10{code}


was (Author: julianhyde):
The concept of a "view parents" can be simplified when we move to Calcite. A view either has a base table (in which case, it is DML-capable) or it does not. The parent is never a view.

Indexes on views should be at most syntactic sugar for functional indexes. For example,

{code}
create table t (a, b, c);
create table v as select a, b + c as d from t where e = 5;
create index iv on v(a, d);
create index it on t(a, b + c);
{code}

I would expect v and iv to have identical contents, and either could e be used to answer the query {code}select * from t where b + c > 10{code}

> Support defining a VIEW over multiple tables
> --------------------------------------------
>
>                 Key: PHOENIX-1505
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1505
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>              Labels: SFDC
>
> Our current view implementation only supports views over a single table. We should enhance this to support creating a view over multiple tables. For example: CREATE VIEW v AS SELECT * FROM DEPT d, EMPL e WHERE d.dept_id = e.dept_id



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