[PERFORM] union all and filter / index scan - seq scan

2015-05-21 Thread Florian Lohoff
Hi, i stumbled over something i cant seem to find a workaround. I create a view like create view v_test as select a,b frombig_table union all select a,b fromsmall_table; When i now use the view like select * from v_test where a = 42; I

Re: [PERFORM] union all and filter / index scan - seq scan

2015-05-21 Thread Vitalii Tymchyshyn
It looks pretty much like partitioning. You should check partitioning recipes. Чт, 21 трав. 2015 06:41 Florian Lohoff f...@zz.de пише: Hi, i stumbled over something i cant seem to find a workaround. I create a view like create view v_test as select a,b frombig_table

Re: [PERFORM] union all and filter / index scan - seq scan

2015-05-21 Thread Tom Lane
Florian Lohoff f...@zz.de writes: It seems the planner is not able to rewrite a union all I do not see any problems with pushing indexable conditions down through a UNION ALL when I try it. I speculate that either you are using a very old 9.1.x minor release, or the actual view is more complex