Re: Table partitioning based on multiple criterias possible? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Table partitioning based on multiple criterias possible?
Date
Msg-id 46E7B724.6020709@archonet.com
Whole thread Raw
In response to Re: Table partitioning based on multiple criterias possible?  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
List pgsql-general
Ow Mun Heng wrote:
> On Wed, 2007-09-12 at 09:42 +0100, Richard Huxton wrote:
>> Well, I suppose you could partition over (month,product) but you
>> probably don't want to. Sounds fiddly to manage.
>
> Yeah.. well current schema w/ everything in 1 table and the way things
> are ordered, normalised design etc, is causing PG to calc stats wrongly
> and i get a 1 to 500x ratio between plan and actual analysed rows which
> is causing queries to run > 2 hours w/o returning results. (this was
> tested w/ on tables w/ only ~3 million rows and joining another table w/
> another 3 million data - one to many relationship, I think, is causing
> the mis-estimates.)

Well, let's see the query + explain. It's not in one of your previous
posts, is it? PG doesn't know about cross-column correlations, but you
can usually get better than 500x out. Since it's taking > 2 hours to get
a result we'll have to settle for explain rather than explain-analyse.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Database/Table Design for Global Country Statistics
Next
From: "sharmi Joe"
Date:
Subject: pgpool II question