Alter table set statistics with partitioned tables

From: Kevin Keith <kkeith(at)borderware(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Alter table set statistics with partitioned tables
Date: 2006-07-24 16:27:25
Message-ID: 44C4F4ED.2090900@borderware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Browse pgsql-admin by date

  From Date Subject
Next Message JieJun Xu 2006-07-25 00:26:51 problem backup/restore PSQL DB
Previous Message Benjamin Krajmalnik 2006-07-24 16:25:37 Re: Unexplained growth of tables