Re: Slow query when used in a view - Mailing list pgsql-performance

From Shaun Thomas
Subject Re: Slow query when used in a view
Date
Msg-id 513F3250.2050208@optionshouse.com
Whole thread Raw
In response to Re: Slow query when used in a view  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
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 work
without major adverse effects. Apparently the tiny table really will be
tiny in actual use, so impact should be minimal.

I just really don't like using subselects that way. :)

Thanks, Tom!

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas@optionshouse.com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email


pgsql-performance by date:

Previous
From: Victor Yegorov
Date:
Subject: Re: Large Table - Slow Window Functions (Better Approach?)
Next
From: Misa Simic
Date:
Subject: Re: Slow concurrent processing