Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 771282E00B0 for ; Tue, 26 Feb 2008 13:12:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 59886-01 for ; Tue, 26 Feb 2008 13:12:22 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by postgresql.org (Postfix) with ESMTP id 0ED9F2E012A for ; Tue, 26 Feb 2008 13:12:07 -0400 (AST) Received: by py-out-1112.google.com with SMTP id d37so4047925pye.29 for ; Tue, 26 Feb 2008 09:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=IPkIM0lcVtA0jA6c4hD3Bu/GXKDPAloTkstRvcNDp+o=; b=kqKP8sW8xHjZln7GirKUAWyhe/kkouCSNkCgprH1v0gvO9D398t1ZZeiPjICu0Wft7CCLDVk2DpAjlemVqmLFsBnQiak+909IubQhWm3qh7XFun0TOcRGY7zbol3y2jq8NeePS6PWDYWrV09S5RUROWvHkU/01hCi95j2D78Z/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=I4eTk9kBc1GCOO5v5P1TSK4zurw8oS/RqQmxHuYg8L7VFqQ+0GsyrecgE/DZlmpfWHvIyiCqg58T1EVonyr67tZEXrQLGicD7dcmfeUycNAYcdIR66sk/ZJEJYA5rEPGtYNc8+c3zpG25zMUVHg4N4EfSr+Yy/oW8u7lImGOJEk= Received: by 10.35.32.3 with SMTP id k3mr5869985pyj.18.1204045927308; Tue, 26 Feb 2008 09:12:07 -0800 (PST) Received: by 10.65.38.3 with HTTP; Tue, 26 Feb 2008 09:12:07 -0800 (PST) Message-ID: <669dc9710802260912y7fe58f9epe42fe7eb360119d8@mail.gmail.com> Date: Tue, 26 Feb 2008 18:12:07 +0100 From: "Laurent Raufaste" To: "Tom Lane" Subject: Re: PG planning randomly ? Cc: pgsql-performance@postgresql.org In-Reply-To: <3637.1204043502@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <669dc9710802260719h61d846b3hd50b7f547bcb82c3@mail.gmail.com> <3637.1204043502@sss.pgh.pa.us> X-Google-Sender-Auth: 03deff3945c2f3be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200802/345 X-Sequence-Number: 28887 2008/2/26, Tom Lane : > > What PG version is this? > > If it's 8.2 or later then increasing the stats target for _comment.path > to 100 or more would likely help. > I'm using PG 8.2.4. We are using 100 as default_statistics_target by default and all our column are using this value: # SELECT attname,attstattarget FROM pg_attribute WHERE attrelid=16743 AND attname='path' ; attname | attstattarget ---------+--------------- path | -1 I tried increasing the stats target with the command: SET default_statistics_target=1000 ; That's the command I launched before executing the ANALYZE showed in the previous mail. The ANALYZE were longer to complete, but it did not change the planner behavior (sometimes right, sometimes wrong). I did not try setting up the target stats directly using an ALTER TABLE because it implies some LOCK on our replication cluster. Do you think the planner will act differently by using an ALTER TABLE rather then just the "SET default_statistics_target" command ? If so, I will try it =) Thanks. -- Laurent Raufaste