Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E7EFDB5DE2E for ; Thu, 1 Sep 2011 20:14:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 94608-02-2 for ; Thu, 1 Sep 2011 23:14:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 69796B5DCE9 for ; Thu, 1 Sep 2011 20:14:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p81NDuph026941; Thu, 1 Sep 2011 19:13:56 -0400 (EDT) To: Mark Kirkwood cc: PGSQL Performance Subject: Re: 8.4 optimization regression? In-reply-to: <5156.1314829311@sss.pgh.pa.us> References: <4E5331FF.3000900@catalyst.net.nz> <15708.1314155740@sss.pgh.pa.us> <4E5DCFA4.5090806@catalyst.net.nz> <5156.1314829311@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 31 Aug 2011 18:21:51 -0400" Date: Thu, 01 Sep 2011 19:13:56 -0400 Message-ID: <26940.1314918836@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/2 X-Sequence-Number: 44778 I wrote: > Mark Kirkwood writes: >> [ assorted examples showing that commit >> 7f3eba30c9d622d1981b1368f2d79ba0999cdff2 has got problems ] > ... > So, not only are you correct that we should revert the changes to > eqjoinsel_inner, but what's happening in eqjoinsel_semi is wrong too. I've retested these examples with the patches I committed yesterday. Six of the eight examples are estimated pretty nearly dead on, while the other two are estimated about 50% too high (still a lot better than before). AFAICT there's no easy way to improve those estimates further; eqjoinsel_semi just plain hasn't got enough information to know how many matches there will be. regards, tom lane