X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1F3959FA502 for ; Mon, 24 Jul 2006 13:36:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 44194-07 for ; Mon, 24 Jul 2006 13:36:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.borderware.com (mail.borderware.com [207.236.65.231]) by postgresql.org (Postfix) with ESMTP id 432F79FA441 for ; Mon, 24 Jul 2006 13:36:07 -0300 (ADT) Message-ID: <44C4F4ED.2090900@borderware.com> Date: Mon, 24 Jul 2006 12:27:25 -0400 From: Kevin Keith User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Alter table set statistics with partitioned tables Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.239 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200607/193 X-Sequence-Number: 22439 I have had to bump the stats on a partitioned table in order to get the planner to use an index over a seqscan. This has worked well in making the system perform where it needs to as it reduced one query's execution from > 45 seconds to < 1 second. The one problem I have run into is that when I create a new child table / table partition, the stats value (attstattarget in pg_attribute) does not get carried over from the parent - instead the system default (-1) is set. Is it supposed to behave this way - meaning that I need to explicitly define the custom value for each child table? Or is there a way for this to be implicitly copied when the child table is created? I prefer not to change the system default on all the tables in the database because the value needs to be increased for one case. Thanks, Kevin