Thanks guys
Lesson learned

On Tue, 4 Sep 2007, Scott Marlowe wrote:

On 8/31/07, Richard Ray <[EMAIL PROTECTED]> 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.


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to