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 174E69FA474 for ; Thu, 11 May 2006 10:46:14 -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 12278-07 for ; Thu, 11 May 2006 10:46:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5277A9FA176 for ; Thu, 11 May 2006 10:46:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k4BDk0lO006136; Thu, 11 May 2006 09:46:00 -0400 (EDT) To: Markus Schaber cc: ogjunk-pgjedan@yahoo.com, pgsql-sql@postgresql.org Subject: Re: Help with a seq scan on multi-million row table In-reply-to: <44631313.1020100@logix-tt.com> References: <20060511034711.46266.qmail@web50305.mail.yahoo.com> <44631313.1020100@logix-tt.com> Comments: In-reply-to Markus Schaber message dated "Thu, 11 May 2006 12:33:55 +0200" Date: Thu, 11 May 2006 09:46:00 -0400 Message-ID: <6135.1147355160@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/99 X-Sequence-Number: 25130 Markus Schaber writes: > Did you try to set higher statistics targets for this columns? Yeah, I was about to suggest the same after looking at the pg_stats entry. It shows estimated num_distinct as 60825, ie only about 60k distinct values in the column, which sounds kinda low (do you know the true figure?). A larger statistics target would probably produce a better number and hence a better join estimate. regards, tom lane