[PERFORM] ...WHERE TRUE" condition in union results in bad query pla

2012-03-03 Thread Claus Stadler
Hi, (Sorry about double post, I just registered on the performance mailing list, but sent the mail from the wrong account - if anyone responds, please respond to this address) Another issue I have encountered :) Query optimizer glitch: "...WHERE TRUE" condition in union results in bad query

Re: [PERFORM] ...WHERE TRUE" condition in union results in bad query pla

2012-03-03 Thread Tom Lane
Claus Stadler writes: > Query optimizer glitch: "...WHERE TRUE" condition in union results in > bad query plan ... Yeah, this is because a nonempty WHERE clause defeats simplifying the UNION ALL into a simple "append relation" (cf is_safe_append_member()). The planner will eventually figure out