pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-performance@postgresql.org
To: Chris Kratz <chris.kratz@vistashare.com>
Subject: Re: Ramifications of turning off Nested Loops for slow queries
Date: Tue, 04 Mar 2008 10:18:43 -0600
Message-ID: <47CD2203.EE98.0025.0@wicourts.gov> (raw)
In-Reply-To: <483ACAF5-A485-40D9-9D7E-7008EF12F909@vistashare.com>
References: <483ACAF5-A485-40D9-9D7E-7008EF12F909@vistashare.com>

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





view thread (5+ messages)  latest in thread

Message-ID: <47CD2203.EE98.0025.0@wicourts.gov>
Permalink:  ../47CD2203.EE98.0025.0@wicourts.gov/
Also on:    postgresql.org/message-id/47CD2203.EE98.0025.0@wicourts.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, chris.kratz@vistashare.com
  Subject: Re: Ramifications of turning off Nested Loops for slow queries
  In-Reply-To: <47CD2203.EE98.0025.0@wicourts.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox