Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D6A466321B8 for ; Tue, 16 Feb 2010 19:39:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 08803-10 for ; Tue, 16 Feb 2010 23:39:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.silentmedia.com (earth.silentmedia.com [216.254.19.12]) by mail.postgresql.org (Postfix) with ESMTP id DECDA6330DF for ; Tue, 16 Feb 2010 19:39:15 -0400 (AST) Received: by mail.silentmedia.com (Postfix, from userid 99) id 1B14610902C; Tue, 16 Feb 2010 15:21:10 -0800 (PST) Received: from sea-2-100370.art.dechocorp.com (unknown [208.185.201.190]) by mail.silentmedia.com (Postfix) with ESMTP id 77EDD10902B for ; Tue, 16 Feb 2010 15:21:05 -0800 (PST) From: Ben Chobot Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/alternative; boundary=Apple-Mail-96-293539565 Subject: Re: another 8.1->8.4 regression Date: Tue, 16 Feb 2010 15:39:08 -0800 In-Reply-To: <84633B63-C6F3-47A1-BC85-AE175BC43CCA@silentmedia.com> To: PostgreSQL Performance References: <84633B63-C6F3-47A1-BC85-AE175BC43CCA@silentmedia.com> Message-Id: X-Mailer: Apple Mail (2.1077) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.904 tagged_above=-10 required=5 tests=AWL=-0.679, BAYES_05=-1.11, HTML_FONT_FACE_BAD=0.884, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/261 X-Sequence-Number: 37682 --Apple-Mail-96-293539565 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Feb 16, 2010, at 1:29 PM, Ben Chobot wrote: > I'm having problems with another one of my queries after moving from = 8.1.19 to 8.4.2. On 8.1.19, the plan looked like this: >=20 > http://wood.silentmedia.com/bench/8119 >=20 > That runs pretty well. On 8.4.2, the same query looks like this: >=20 > http://wood.silentmedia.com/bench/842_bad >=20 > If I turn off mergejoin and hashjoin, I can get 8.4.2 to spit out = this: >=20 > http://wood.silentmedia.com/bench/842_better >=20 > ...which it thinks is going to suck but which does not.=20 >=20 > The query and relevant table definitions are here: >=20 > http://wood.silentmedia.com/bench/query_and_definitions >=20 >=20 > Any suggestions? I'm guessing the problem is with the absurd = over-estimation on the nested loop under the sort node, but I'm not sure = why it's so bad.=20 After looking at this some more, I'm pretty confused at both of 8.4.2's = plans. They both have a Nested Loop node in them where the expected row = count is a bit over 2 million, and yet the inner nodes have expected row = counts of 1 and 152. I was under the impression that a nested loop = between R and S would return no more than R*S?= --Apple-Mail-96-293539565 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
I'm having problems with = another one of my queries after moving from 8.1.19 to 8.4.2. On 8.1.19, = the plan looked like this:


That runs pretty well. On = 8.4.2, the same query looks like this:


If I turn off mergejoin = and hashjoin, I can get 8.4.2 to spit out = this:


...which it thinks = is going to suck but which does not. 

The = query and relevant table definitions are = here:



Any suggestions? I'm guessing the problem is with the = absurd over-estimation on the nested loop under the sort node, but I'm = not sure why it's so = bad. 


After = looking at this some more, I'm pretty confused at both of 8.4.2's plans. = They both have a Nested Loop node in them where the expected row count = is a bit over 2 million, and yet the inner nodes have expected row = counts of 1 and 152. I was under the impression that a nested loop = between R and S would return no more than R*S?
= --Apple-Mail-96-293539565--