Re: Table partitioning based on multiple criterias possible?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Table partitioning based on multiple criterias possible?
Date: 2007-09-12 09:53:40
Message-ID: 46E7B724.6020709@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message sharmi Joe 2007-09-12 11:25:49 pgpool II question
Previous Message Richard Huxton 2007-09-12 09:45:18 Re: Database/Table Design for Global Country Statistics