Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8765F63488A for ; Mon, 23 Mar 2009 11:29:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 22400-09 for ; Mon, 23 Mar 2009 11:29:06 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 6AC4D633A17 for ; Mon, 23 Mar 2009 11:29:05 -0300 (ADT) 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 mx1.hub.org (Postfix) with ESMTP id 52195125AE19 for ; Mon, 23 Mar 2009 11:28:38 -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 n2NEQcEK008647; Mon, 23 Mar 2009 10:26:38 -0400 (EDT) To: Romuald Brunet cc: pgsql-performance@postgresql.org Subject: Re: Slower query after psql changed it's execution plan In-reply-to: <8ae589230903230652n294f456dn6e3ec7a39bb4c0aa@mail.gmail.com> References: <8ae589230903230652n294f456dn6e3ec7a39bb4c0aa@mail.gmail.com> Comments: In-reply-to Romuald Brunet message dated "Mon, 23 Mar 2009 14:52:44 +0100" Date: Mon, 23 Mar 2009 10:26:38 -0400 Message-ID: <8646.1237818398@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL=0.010 X-Spam-Level: X-Archive-Number: 200903/328 X-Sequence-Number: 33250 Romuald Brunet writes: > After some investigation, we found out that the PostgreSQL server > (8.1) changed the execution plan (I'm assuming because the number of > rows increased). The problem seems to be that the estimate for the number of rows fetched from dc_post changed drastically --- it was in the right ballpark, and now it's off by a factor of 30. Why is that? Maybe you had had a special statistics target setting, and it got dropped? > The statistics are at the default value everywhere (10) Almost certainly not enough. regards, tom lane