You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Hans Zeller (JIRA)" <ji...@apache.org> on 2016/10/10 21:55:21 UTC

[jira] [Updated] (TRAFODION-2273) Predicate on "partition by" columns in sequence function should be pushed down

     [ https://issues.apache.org/jira/browse/TRAFODION-2273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hans Zeller updated TRAFODION-2273:
-----------------------------------
    Description: 
The sequence operator that implements OLAP functions like RANK() has to prevent certain predicates from being pushed down. Right now it is too conservative, though. It prevents predicates on the PARTITION BY columns from being pushed down, too. Here is an example:

{noformat}
create table tseq1(a int, b int);
insert into tseq1 values (1,1), (1,2), (2,1), (2,2);

explain
select *
from (select a, b, rank() over(partition by a order by b) r
      from tseq1)
where a < 2 and b = 1 and r > 1;
{noformat}

Predicate "a<2" should be pushed down to the scan of table tseq1, but it isn't. This is not incorrect, but also not very efficient.

  was:
The sequence operator that implement OLAP functions like RANK() has to prevent certain predicates from being pushed down. Right now it is too conservative, though, in preventing predicates on the PARTITION BY columns from being pushed down, too. Here is an example:

{noformat}
create table tseq1(a int, b int);
insert into tseq1 values (1,1), (1,2), (2,1), (2,2);

explain
select *
from (select a, b, rank() over(partition by a order by b) r
      from tseq1)
where a < 2 and b = 1 and r > 1;
{noformat}

Predicate "a<2" should be pushed down to the scan of table tseq1, but it isn't. This is not incorrect, but also not very efficient.


> Predicate on "partition by" columns in sequence function should be pushed down
> ------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2273
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2273
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.0-incubating
>            Reporter: Hans Zeller
>            Priority: Minor
>
> The sequence operator that implements OLAP functions like RANK() has to prevent certain predicates from being pushed down. Right now it is too conservative, though. It prevents predicates on the PARTITION BY columns from being pushed down, too. Here is an example:
> {noformat}
> create table tseq1(a int, b int);
> insert into tseq1 values (1,1), (1,2), (2,1), (2,2);
> explain
> select *
> from (select a, b, rank() over(partition by a order by b) r
>       from tseq1)
> where a < 2 and b = 1 and r > 1;
> {noformat}
> Predicate "a<2" should be pushed down to the scan of table tseq1, but it isn't. This is not incorrect, but also not very efficient.



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