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

Steven Hawkins (JIRA) issues at jboss.org
Wed Apr 16 15:20:34 EDT 2014


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

Steven Hawkins closed TEIID-2878.
---------------------------------


    
> 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