X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5FFB59DC805 for ; Fri, 10 Mar 2006 19:40:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74577-06 for ; Fri, 10 Mar 2006 19:40:42 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E97B89DCA1B for ; Fri, 10 Mar 2006 19:40:37 -0400 (AST) 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 k2ANeetI022203; Fri, 10 Mar 2006 18:40:40 -0500 (EST) To: "Marc Morin" cc: pgsql-performance@postgresql.org Subject: Re: Trouble managing planner for timestamptz columns In-reply-to: <2BCEB9A37A4D354AA276774EE13FB8C2BCC473@mailserver.sandvine.com> References: <2BCEB9A37A4D354AA276774EE13FB8C2BCC473@mailserver.sandvine.com> Comments: In-reply-to "Marc Morin" message dated "Fri, 10 Mar 2006 16:47:08 -0500" Date: Fri, 10 Mar 2006 18:40:40 -0500 Message-ID: <22202.1142034040@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.112 required=5 tests=[AWL=0.112] X-Spam-Score: 0.112 X-Spam-Level: X-Archive-Number: 200603/145 X-Sequence-Number: 17582 "Marc Morin" writes: > Well this analyze just took 12 minutes... Stats target of 100. > # time psql xxx xxx -c "analyze elem_trafficstats_1" Try analyzing just the one column, and try reducing its stats target to 10. It does make a difference: sorttest=# set default_statistics_target TO 100; SET Time: 0.382 ms sorttest=# analyze verbose d10; INFO: analyzing "public.d10" INFO: "d10": scanned 30000 of 833334 pages, containing 3600000 live rows and 0 dead rows; 30000 rows in sample, 100000080 estimated total rows ANALYZE Time: 137186.347 ms sorttest=# set default_statistics_target TO 10; SET Time: 0.418 ms sorttest=# analyze verbose d10(col1); INFO: analyzing "public.d10" INFO: "d10": scanned 3000 of 833334 pages, containing 360000 live rows and 0 dead rows; 3000 rows in sample, 100000080 estimated total rows ANALYZE Time: 17206.018 ms sorttest=# regards, tom lane