Re: Ramifications of turning off Nested Loops for slow queries

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-performance(at)postgresql(dot)org>, "Chris Kratz" <chris(dot)kratz(at)vistashare(dot)com>
Subject: Re: Ramifications of turning off Nested Loops for slow queries
Date: 2008-03-04 16:18:43
Message-ID: 47CD2203.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> On Tue, Mar 4, 2008 at 8:42 AM, in message
<483ACAF5-A485-40D9-9D7E-7008EF12F909(at)vistashare(dot)com>, Chris Kratz
<chris(dot)kratz(at)vistashare(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2008-03-04 16:25:25 Re: Performance tuning on FreeBSD
Previous Message Theo Kramer 2008-03-04 15:43:00 PostgreSQL performance on a virtual host