pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <andrew@libertyrms.info>
To: pgsql-performance@postgresql.org
Subject: Re: Odd explain estimate
Date: Fri, 1 Aug 2003 08:16:12 -0400
Message-ID: <20030801121612.GD18200@libertyrms.info> (raw)
In-Reply-To: <20030731225959.GH55392@nasby.net>
References: <20030731195145.GD55392@nasby.net>
	<20030731205921.GF16230@libertyrms.info>
	<20030731225959.GH55392@nasby.net>

On Thu, Jul 31, 2003 at 05:59:59PM -0500, Jim C. Nasby wrote:
>  
> Well, if I don't do this it wants to seqscan a table that occupies 350k
> pages, instead of pulling a couple thousand rows. I started running it
> with the seqscan and it's already taken way longer than it does if I
> disable seqscan.

That was indeed the question. 

If it uses a seqscan when it ought not to do, then there's something
wrong with the statistics, or you haven't vacuum analysed correctly,
or your table needs vacuum full (is it really 350k pages, or is that
mostly dead space?), &c. -- all the usual bad-seqscan candidates.

enable_seqscan=off is probably not a good strategy for any moderately
complicated query.  If the planner were perfect, of course, you'd
never need it at all.

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




view thread (5+ messages)  latest in thread

Message-ID: <20030801121612.GD18200@libertyrms.info>
Permalink:  ../20030801121612.GD18200@libertyrms.info/
Also on:    postgresql.org/message-id/20030801121612.GD18200@libertyrms.info

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: andrew@libertyrms.info
  Subject: Re: Odd explain estimate
  In-Reply-To: <20030801121612.GD18200@libertyrms.info>
  References: <20030731195145.GD55392@nasby.net> <20030731205921.GF16230@libertyrms.info> <20030731225959.GH55392@nasby.net> <20030801121612.GD18200@libertyrms.info>

* 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