X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D8B6253B12 for ; Wed, 11 May 2005 16:57:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76094-10 for ; Wed, 11 May 2005 19:57:07 +0000 (GMT) Received: from soufre.accelance.net (soufre.accelance.net [213.162.48.15]) by svr1.postgresql.org (Postfix) with ESMTP id 00870538E0 for ; Wed, 11 May 2005 16:57:03 -0300 (ADT) Received: from [82.122.171.172] (ALyon-252-1-61-172.w82-122.abo.wanadoo.fr [82.122.171.172]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by soufre.accelance.net (Postfix) with ESMTP id 0C1005D38; Wed, 11 May 2005 21:57:03 +0200 (CEST) Message-ID: <4282638E.2020307@smet.org> Date: Wed, 11 May 2005 21:57:02 +0200 From: Guillaume Smet User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: josh@agliodbs.com, pgsql-performance@postgresql.org Subject: Re: Bad plan after vacuum analyze References: <42823F94.8050009@smet.org> <200505111110.15983.josh@agliodbs.com> <13964.1115837926@sss.pgh.pa.us> <42825DBB.7000703@smet.org> <14301.1115840296@sss.pgh.pa.us> In-Reply-To: <14301.1115840296@sss.pgh.pa.us> X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/217 X-Sequence-Number: 12381 > Well, those stats certainly appear to justify the planner's belief that > the indexscan needn't run very far: the one value of > parent_application_id is 1031 and this is below the smallest value of > object_id seen by analyze. Yes, it seems rather logical but why does it cost so much if it should be an effective way to find the row? > You might have better luck if you increase > the statistics target for acs_objects.object_id. What do you mean exactly? > (It'd be interesting > to know what fraction of acs_objects actually does have object_id < 1032.) ccm_perf=# SELECT COUNT(*) FROM acs_objects WHERE object_id<1032; count ------- 15 ccm_perf=# SELECT COUNT(*) FROM acs_objects; count ------- 33510 -- Guillaume