Re: [GENERAL] How to push predicate down

2012-01-26 Thread Tom Lane
I wrote: > Hmm. The code explicitly won't push conditions down through an EXCEPT: > * 3. If the subquery contains EXCEPT or EXCEPT ALL set ops we cannot push > * quals into it, because that could change the results. > I remember coming to the conclusion that this is safe for > UNION/INTERSECT bu

Re: [GENERAL] How to push predicate down

2012-01-26 Thread salah jubeh
  From: Tom Lane To: salah jubeh Cc: Volodymyr Kostyrko ; pgsql Sent: Thursday, January 26, 2012 5:47 PM Subject: Re: [GENERAL] How to push predicate down salah jubeh writes: > Sorry,  The scenario, that I posted was not correct. I have traced it and the >

Re: [GENERAL] How to push predicate down

2012-01-26 Thread Tom Lane
salah jubeh writes: > Sorry,  The scenario, that I posted was not correct. I have traced it and the > union was not the problem, As I said the query excusion plan is over 5000 > line. I have created a scenario which similar to the scenario causes the > problem I have. > [ query uses EXCEPT no

Re: [GENERAL] How to push predicate down

2012-01-26 Thread salah jubeh
(cost=60.52..62.67 rows=860 width=64) (actual time=0.010..0.012 rows=1 loops=1)" "  Sort Key: tr.col1, tr.col3" "      Sort Method:  quicksort  Memory: 25kB" "  ->

Re: [GENERAL] How to push predicate down

2012-01-26 Thread Volodymyr Kostyrko
salah jubeh wrote: Hello Guys, In the past I had a view defined as follows CREATE view abcd as SELECT whatever .. --- query1 Some business requierments came up and I had to change it like this CREATE view abcd as SELECT whatever .. --- query1 UNION SELECT whatever .. query2

[GENERAL] How to push predicate down

2012-01-26 Thread salah jubeh
Hello Guys, In the past  I had a view defined as follows CREATE view abcd as SELECT whatever .. --- query1 Some business requierments came up and I had to change it like this   CREATE view abcd as SELECT whatever .. --- query1 UNION SELECT whatever .. query2 Now I have