pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Ray <rray@mstc.state.ms.us>
To: pgsql-sql@postgresql.org
Subject: Re: How to influence the planner
Date: Tue, 4 Sep 2007 10:56:04 -0500 (CDT)
Message-ID: <Pine.LNX.4.64.0709041054590.12018@rray.drdc.mstc.ms.gov> (raw)
In-Reply-To: <dcc563d10709040711k42c113b0md21f02c4281ade95@mail.gmail.com>
References: <Pine.LNX.4.64.0708311116000.17749@rray.drdc.mstc.ms.gov>
	<373D2F52-E9CD-485A-9BF1-B019349FA5EC@seespotcode.net>
	<Pine.LNX.4.64.0708311557140.17749@rray.drdc.mstc.ms.gov>
	<2005.1188596277@sss.pgh.pa.us>
	<Pine.LNX.4.64.0708311856550.7540@rray.drdc.mstc.ms.gov>
	<dcc563d10709040711k42c113b0md21f02c4281ade95@mail.gmail.com>

Thanks guys
Lesson learned

On Tue, 4 Sep 2007, Scott Marlowe wrote:

> On 8/31/07, Richard Ray <rray@mstc.state.ms.us> wrote:
>
>> Changing to enable_seqscan = on does solve this problem, thanks
>> Is there some method of crafting a query that will assert my wishes to the planner
>> When is enable_seqscan = off appropriate
>
> enable_xxx = off are troubleshooting tools.  They override the query planner.
>
> For instance, I had a query that was running slow, and using set
> enable_nestloop=off allowed the query to run fast.  However, using
> explain analyze I could see that the estimated number of rows was off.
> Analyze didn't fix it, so I increased the stats target for the column
> I was working with, reanalyzed, and voila, the query ran fine with
> nestloop=on.
>
> So, enable_xxx=off is normally only appropriate when troubleshooting
> an issue, not as a fix all.  That's doubly true for
> enable_seqscan=off.
>
> If you do have a query that nothing else seems to work on it, you can
> set one of the enable_xxx settings off for that connection only and
> not worry about messing up all the other sessions connecting to your
> db.
>



view thread (10+ messages)

Message-ID: <Pine.LNX.4.64.0709041054590.12018@rray.drdc.mstc.ms.gov>
Permalink:  ../Pine.LNX.4.64.0709041054590.12018@rray.drdc.mstc.ms.gov/
Also on:    postgresql.org/message-id/Pine.LNX.4.64.0709041054590.12018@rray.drdc.mstc.ms.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-sql@postgresql.org
  Cc: rray@mstc.state.ms.us
  Subject: Re: How to influence the planner
  In-Reply-To: <Pine.LNX.4.64.0709041054590.12018@rray.drdc.mstc.ms.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