Re: [PERFORM] very slow left join

2008-05-16 Thread Craig Ringer
Ben wrote: On Fri, 16 May 2008, Scott Marlowe wrote: Well, I'm guessing that you aren't in locale=C and that the text Correct, I am not. And my understanding is that by moving to the C locale, I would loose utf8 validation, so I don't want to go there. Though, it's news to me that I would g

Re: [PERFORM] very slow left join

2008-05-16 Thread Ben
On Fri, 16 May 2008, Scott Marlowe wrote: Well, I'm guessing that you aren't in locale=C and that the text Correct, I am not. And my understanding is that by moving to the C locale, I would loose utf8 validation, so I don't want to go there. Though, it's news to me that I would get any kind

Re: [PERFORM] very slow left join

2008-05-16 Thread Scott Marlowe
On Fri, May 16, 2008 at 12:21 PM, Ben <[EMAIL PROTECTED]> wrote: > On Fri, 16 May 2008, Scott Marlowe wrote: > >> Just for giggles, try running the query like so: >> >> set enable_nestloop = off; >> explain analyze ... >> >> and see what happens. I'm guessing that the nested loops are bad choices

Re: [PERFORM] very slow left join

2008-05-16 Thread Ben
On Fri, 16 May 2008, Scott Marlowe wrote: Just for giggles, try running the query like so: set enable_nestloop = off; explain analyze ... and see what happens. I'm guessing that the nested loops are bad choices here. You guess correctly, sir! Doing so shaves 3 orders of magnitude off the r

Re: [PERFORM] very slow left join

2008-05-16 Thread Scott Marlowe
On Fri, May 16, 2008 at 11:56 AM, Ben <[EMAIL PROTECTED]> wrote: > I've inherited an Oracle database that I'm porting to Postgres, and this has > been going quite well until now. Unfortunately, I've found one view (a > largish left join) that runs several orders of magnitude slower on Postgres > th