Re: Declarative partitioning grammar

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Markus Schiltknecht" <markus(at)bluegap(dot)ch>
Cc: "Hans-Juergen Schoenig" <postgres(at)cybertec(dot)at>, "Hannu Krosing" <hannu(at)tm(dot)ee>, "Jeff Cohen" <jcohen(at)greenplum(dot)com>, "Warren Turkal" <turkal(at)google(dot)com>, "Ron Mayer" <rm_pg(at)cheapcomplexdevices(dot)com>, "Gavin Sherry" <swm(at)alcove(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Declarative partitioning grammar
Date: 2008-01-15 16:12:25
Message-ID: 878x2rhxue.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Markus Schiltknecht" <markus(at)bluegap(dot)ch> writes:

> Hi,
>
> Hans-Juergen Schoenig wrote:
>>> What do you need so many partitions for?
>>
>> having so many tables is not funny but it can be the only reasonable choice.
>
> Well, what do you do with all those partitions?

In a previous life I had a database which had daily partitions. I assure you
it was unquestionably the right decision. Each day's data wasn't just
distinguished by the timestamp but actually was entirely separate from the
previous day's data. Both the archiving strategy and the many reports which
were ran all depended specifically on the day the data was collected on.

Much like partial indexes the partition key effectively gives you a free index
key element which can be combined with any other index without extra i/o.
Often this lets you avoid a sort letting you perform some queries as OLTP
queries with no startup cost which otherwise would have DSS style plans with
sorts. Better yet it can be used even in a sequential scan which performs
better than even a perfectly clustered index.

Daily partitioned let us go from a weekly batch job which was threatening to
overrun the maintenance window to a daily batch job which completed in
minutes. As a result data warehouse reports could be delivered the same night
instead of being hours, and in some cases days, delayed.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-01-15 16:14:30 Re: Array behavior oddities
Previous Message Tom Lane 2008-01-15 16:06:41 Re: SSL over Unix-domain sockets