X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D572A9F9430 for ; Thu, 11 May 2006 07:33:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 94967-06 for ; Thu, 11 May 2006 07:33:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (unknown [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 7E29F9FA2F8 for ; Thu, 11 May 2006 07:33:43 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (p549D1402.dip0.t-ipconnect.de [84.157.20.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id C184965836; Thu, 11 May 2006 12:34:53 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 6FBEC181520E4; Thu, 11 May 2006 12:33:55 +0200 (CEST) Message-ID: <44631313.1020100@logix-tt.com> Date: Thu, 11 May 2006 12:33:55 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: ogjunk-pgjedan@yahoo.com Cc: pgsql-sql@postgresql.org Subject: Re: Help with a seq scan on multi-million row table References: <20060511034711.46266.qmail@web50305.mail.yahoo.com> In-Reply-To: <20060511034711.46266.qmail@web50305.mail.yahoo.com> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/98 X-Sequence-Number: 25129 Hi, Otis, ogjunk-pgjedan@yahoo.com wrote: > I'm not sure which numbers you are referring to when you said the estimate is off, but here are some numbers: > The whole table has 6-7 M rows. > That query matches about 2500 rows. > > If there are other things I can play with and help narrow this down, please let me know. Did you try to set higher statistics targets for this columns? For experimenting, I'd try to set it to 100 or even higher, then ANALYZE the table, and then retest the query. HTH, Marks -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org