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

Tom Arnold (JIRA) issues at jboss.org
Mon Mar 3 08:58:48 EST 2014


Tom Arnold created TEIID-2878:
---------------------------------

             Summary: 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


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.

{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