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

From Kevin Grittner
Subject Re: Ramifications of turning off Nested Loops for slow queries
Date
Msg-id 47CD2203.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Ramifications of turning off Nested Loops for slow queries  (Chris Kratz <chris.kratz@vistashare.com>)
Responses Re: Ramifications of turning off Nested Loops for slow queries
Re: Ramifications of turning off Nested Loops for slow queries
List pgsql-performance
>>> On Tue, Mar 4, 2008 at  8:42 AM, in message
<483ACAF5-A485-40D9-9D7E-7008EF12F909@vistashare.com>, Chris Kratz
<chris.kratz@vistashare.com> wrote:

> 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.

In our environment, the fastest plan for a lot of queries involve
nested loops.  Of course, it's possible that these never provide the
fasted plan in your environment, but it seems very unlikely --
you're just not noticing the queries where it's doing fine.

> Any other thoughts or suggestions?

Make sure your effective_cache_size is properly configured.

Increase random_page_cost and/or decrease seq_page_cost.
You can play with the cost settings on a connection, using EXPLAIN
on the query, to see what plan you get with each configuration
before putting it into the postgresql.conf file.

-Kevin




pgsql-performance by date:

Previous
From: Theo Kramer
Date:
Subject: PostgreSQL performance on a virtual host
Next
From: Greg Smith
Date:
Subject: Re: Performance tuning on FreeBSD