Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D21F564FC48 for ; Mon, 8 Dec 2008 09:14:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 32338-06 for ; Mon, 8 Dec 2008 09:14:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web23604.mail.ird.yahoo.com (web23604.mail.ird.yahoo.com [87.248.115.47]) by mail.postgresql.org (Postfix) with SMTP id AACDD64FDBB for ; Mon, 8 Dec 2008 09:14:18 -0400 (AST) Received: (qmail 89783 invoked by uid 60001); 8 Dec 2008 13:14:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=Z5cdewyWua7aYJzvZqnZD77K8Fbjr4yPZ4PI1rfX8GZ3T/O6u73I6oGnS1pdb843yUONnUhSfdYgxuYtvatagETFmu57MQfvxbQoKavcSQguYT5UH5UeB8MTQqYs6ynYb/srjfiegYw6v7mWBvZt+iwUcFQ16bCH+DIcIHiNy78=; X-YMail-OSG: 9TSBd2MVM1m2_u_RJyfM7mnR3dcqCHzf849QQb1WSGrVAqZaxUzmu481q23CfxYGC.s0PwaYMMyBCwYg.wAnufitumCuRXuySCsEs6hJ4zaO24XJ0z79Qb8Npw.qfnIj.xiORCQvnDBW.AeOJ14S7JhgJIVwAke3kTEMBRnWsVp3kA-- Received: from [83.166.184.142] by web23604.mail.ird.yahoo.com via HTTP; Mon, 08 Dec 2008 13:14:15 GMT X-Mailer: YahooMailWebService/0.7.260.1 Date: Mon, 8 Dec 2008 13:14:15 +0000 (GMT) From: Glyn Astill Reply-To: glynastill@yahoo.co.uk Subject: Re: Planner picking topsey turvey plan? To: Tom Lane Cc: pgsql-general@postgresql.org In-Reply-To: <5092.1228701731@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <161682.80009.qm@web23604.mail.ird.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/297 X-Sequence-Number: 141429 > From: Tom Lane >=20 > You've provided no evidence that this is a bad plan. >=20 Looks like I didn't take the time to understand properly what the explains = were showing. > In particular, the plan you seem to think would be better > would involve > an estimated 153 iterations of the cost-15071 hash > aggregation, which > simple arithmetic shows is more expensive than the plan it > did choose. >=20 I'd totally missed that all the cost was in the view that I'd created. Thanks tom=0A=0A=0A