[PERFORM] pushing order by + limit to union subqueries

2015-02-28 Thread Paolo Losi
Hi all, I've noticed that order by / limit are not distributed to union subqueries by the planner: Example: q1: (select * from t1) union all (select * from t2) order by x limit 10; q2: (select * from t1 order by x limit 10) union all (select * from t2 order by x limit 10) order by x limit

Re: [PERFORM] pushing order by + limit to union subqueries

2015-02-28 Thread Tom Lane
Paolo Losi writes: > I've noticed that order by / limit are not distributed to union subqueries > by the planner: > Example: > q1: (select * from t1) union all (select * from t2) order by x limit 10; > q2: (select * from t1 order by x limit 10) union all (select * from t2 > order by x limit 10)