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 7FD2353C9D for ; Wed, 11 May 2005 16:38:30 -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 73308-06 for ; Wed, 11 May 2005 19:38:24 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 729C8538E6 for ; Wed, 11 May 2005 16:38:17 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j4BJcGxQ014302; Wed, 11 May 2005 15:38:17 -0400 (EDT) To: Guillaume Smet Cc: josh@agliodbs.com, pgsql-performance@postgresql.org Subject: Re: Bad plan after vacuum analyze In-reply-to: <42825DBB.7000703@smet.org> References: <42823F94.8050009@smet.org> <200505111110.15983.josh@agliodbs.com> <13964.1115837926@sss.pgh.pa.us> <42825DBB.7000703@smet.org> Comments: In-reply-to Guillaume Smet message dated "Wed, 11 May 2005 21:32:11 +0200" Date: Wed, 11 May 2005 15:38:16 -0400 Message-ID: <14301.1115840296@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/216 X-Sequence-Number: 12380 Guillaume Smet writes: >> If so, can we see the pg_stats rows for the object_id and >> parent_application_id columns? > See attached file. 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. You might have better luck if you increase the statistics target for acs_objects.object_id. (It'd be interesting to know what fraction of acs_objects actually does have object_id < 1032.) regards, tom lane