[teiid-issues] [JBoss JIRA] (TEIID-2878) Push ORDER/LIMIT for UNION query

Steven Hawkins (JIRA) issues at jboss.org
Tue Mar 4 13:13:33 EST 2014


     [ https://issues.jboss.org/browse/TEIID-2878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Hawkins resolved TEIID-2878.
-----------------------------------

    Fix Version/s: 8.7
       Resolution: Done


Added logic in rulepushlimit to push both the limit and the order by through union branches.  This is mostly for the case that the limit/order by is supported by the source as we don't yet have a more advanced sorted sublist style processing for the sort above the union.
                
> Push ORDER/LIMIT for UNION query
> --------------------------------
>
>                 Key: TEIID-2878
>                 URL: https://issues.jboss.org/browse/TEIID-2878
>             Project: Teiid
>          Issue Type: Enhancement
>          Components: Query Engine
>    Affects Versions: 8.7
>            Reporter: Tom Arnold
>            Assignee: Steven Hawkins
>            Priority: Minor
>             Fix For: 8.7
>
>
> Better support for queries on unions between different sources. ORDER BY is necessary on the inner queries because otherwise the result set will be truncated too early. ORDER BY can be hardcoded on the inner queries but this limits flexibility. Currently in 8.6 if LIMIT is not hardcoded on inner queries, ORDER BY will be stripped from query.
> {code:sql}
> create view v_items (...) as
> select * from (
>   (select item_id, created_at, 'Foo' source from foo.items)
>    union all
>   (select item_id, created_at, 'Bar' source from bar.items)
> ) x;
> -- Page 1.
> select * from v_items order by created_at desc limit 0, 500;
> -- Page 2.
> select * from v_items order by created_at desc limit 500, 500;
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the teiid-issues mailing list