Re: [PERFORM] Slow query when used in a view

2013-03-12 Thread Shaun Thomas
On 03/11/2013 06:56 PM, Tom Lane wrote: And that means that you get the inefficient plan wherein the foo-to-tiny_foo join is computed in its entirety. :( That's unfortunate, though I guess it makes sense. I moved the join in the view into the SELECT clause as an EXISTS, and that seems to

Re: [PERFORM] Slow query when used in a view

2013-03-11 Thread Tom Lane
Shaun Thomas stho...@optionshouse.com writes: A developer was complaining about a view he created to abstract an added column in a left join. ... Curious, I whipped up this test case: CREATE VIEW v_slow_view AS SELECT foo.*, tf.small_label IS NOT NULL AS has_small_label FROM foo