Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 132779FBA15 for ; Wed, 14 Feb 2007 21:30:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 21757-04 for ; Wed, 14 Feb 2007 21:30:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from web52310.mail.yahoo.com (web52310.mail.yahoo.com [206.190.48.153]) by postgresql.org (Postfix) with SMTP id 794A29FBADC for ; Wed, 14 Feb 2007 21:30:48 -0400 (AST) Received: (qmail 64732 invoked by uid 60001); 15 Feb 2007 01:30:46 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Message-ID:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=HhISxKUG558tks+gLa8oOAGIpDgRTx6NYwO32+o2yOyRcEKzsLgnoA1RXszYLScQBB6sCM5UoBusw0wiAin5RCkR1+tCiDjb2pvhRbOjmdbt6RRuqoDu/Cqq9VuwgSjX6Ta7ruSMNBO7OX7nyfiXTutbCDNcKVZvDCtV2DKxUjY= ; Message-ID: <20070215013046.64730.qmail@web52310.mail.yahoo.com> Received: from [202.156.8.12] by web52310.mail.yahoo.com via HTTP; Wed, 14 Feb 2007 17:30:46 PST X-Mailer: YahooMailRC/368.7 YahooMailWebService/0.6.132.8 Date: Wed, 14 Feb 2007 17:30:46 -0800 (PST) From: Brian Herlihy Subject: Re: An unwanted seqscan To: Postgresql Performance MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/164 X-Sequence-Number: 23218 Hi Tom,=0A=0ASorry, I didn't ask the right question. I meant to ask "Why d= oes it estimate a smaller cost for the seqscan?"=0A=0AWith some further sta= ring I was able to find the bad estimate and fix it by increasing the relev= ant statistics target.=0A=0AThanks,=0ABrian=0A=0A----- Original Message ---= -=0AFrom: Tom Lane =0ATo: Brian Herlihy =0ACc: Postgresql Performance =0ASen= t: Wednesday, 14 February, 2007 4:53:54 PM=0ASubject: Re: [PERFORM] An unwa= nted seqscan =0A=0ABrian Herlihy writes:=0A> I am hav= ing trouble understanding why a seqscan is chosen for this query.=0A=0AAs f= ar as anyone can see from this output, the planner's decisions are=0Acorrec= t: it prefers the plans with the smaller estimated cost. If you=0Awant us = to take an interest, provide some more context --- EXPLAIN=0AANALYZE output= for starters.=0A=0A regards, tom lane=0A=0A--------------------= -------(end of broadcast)---------------------------=0ATIP 3: Have you chec= ked our extensive FAQ?=0A=0A http://www.postgresql.org/docs/f= aq=0A=0A=0A