Re: Declarative partitioning grammar

From: Jeff Cohen <jcohen(at)greenplum(dot)com>
To: Mike <ipso(at)snappymail(dot)ca>
Cc: Gavin Sherry <swm(at)alcove(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Declarative partitioning grammar
Date: 2008-01-12 01:06:23
Message-ID: D944AB1E-609C-4906-BF89-8F244F9EEEB0@greenplum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Jan 11, 2008, at 4:03 PM, Mike wrote:

> Pardon my ignorance as I've never actually used partitioning before
> but
> plan to in the near future, but couldn't the grammar resemble a common
> WHERE clause more closely?
>>

Hi Mike,

Thanks for your suggestions. The current syntax we chose is similar
to syntax used by IBM, Oracle, and mysql, so it is familiar to folks
who have used partitioning with other databases. A WHERE clause
would of course be understandable by everyone, but it makes error
checking more difficult, since we want to ensure that partition
specifications don't overlap. In order to make such error checking
feasible, we would have to restrict the set of predicates you can use
in the WHERE clause, so it wouldn't be completely general anyway.

> Is there really a reason to not have a named partition as well?
> Sure it
> saves a few keystrokes, but it makes trying to do anything with
> them at
> a later date that much more difficult.

For the case of partition by HASH, you can just specify the number of
buckets, so it might not be meaningful to name the partitions. For
range partitions, many users perform "rolling upgrades" on a regular
basis, where they drop the oldest data and add a new partition with
the latest data, so they might just refer to partitions by
"position" (either an ordinal number or using a keyword like FIRST/
LAST).

kind regards,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message August Zajonc 2008-01-12 01:53:37 Re: Dynamic Partitioning using Segment Visibility Maps
Previous Message Neil Conway 2008-01-12 01:03:00 DECLARE CURSOR code question