Ramifications of turning off Nested Loops for slow queries - Mailing list pgsql-performance

From Chris Kratz
Subject Ramifications of turning off Nested Loops for slow queries
Date
Msg-id 483ACAF5-A485-40D9-9D7E-7008EF12F909@vistashare.com
Whole thread Raw
Responses Re: Ramifications of turning off Nested Loops for slow queries
List pgsql-performance
Hello Everyone,

I had posted an issue previously that we've been unable to resolve.
An early mis-estimation in one or more subqueries causes the remainder
of the query to choose nested loops instead of a more efficient method
and runs very slowly (CPU Bound).  I don't think there is any way to
"suggest" to the planner it not do what it's doing, so we are starting
to think about turning off nested loops entirely.

Here is the history so far:

http://archives.postgresql.org/pgsql-performance/2008-02/msg00205.php

At the suggestion of the list, we upgraded to 8.2.6 and are still
experiencing the same problem.  I'm now installing 8.3 on my
workstation  to see if it chooses a better plan, but it will take some
time to get it compiled, a db loaded, etc.

We have a number of very long running reports that will run in seconds
if nested loops are turned off.  The other alternative we are
exploring is programmatically turning off nested loops just for the
problematic reports.  But with the speedups we are seeing, others are
getting gun shy about having them on at all.

So, I've now been asked to ping the list as to whether turning off
nested loops system wide is a bad idea, and why or why not.

Any other thoughts or suggestions?

Thanks,

-Chris

pgsql-performance by date:

Previous
From: Matthew
Date:
Subject: Re: Performance tuning on FreeBSD
Next
From: Shane Ambler
Date:
Subject: Re: How to allocate 8 disks