Re: Auto creation of Partitions

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Jim Nasby" <decibel(at)decibel(dot)org>
Cc: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "NikhilS" <nikkhils(at)gmail(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Auto creation of Partitions
Date: 2007-03-08 10:12:30
Message-ID: 87wt1s6o35.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Jim Nasby" <decibel(at)decibel(dot)org> writes:

> One possibility would be to require 3 functions for a partitioned table: one
> accepts the partitioning key and tells you what partition it's in, one that
> tells you what the minimum partitioning key for a partition would be, and one
> that tells you what the maximum would be. If the user supplied those 3
> functions, I think it would be possibly to automatically generate code for the
> triggers and check constraints. The min/max partition key functions might
> allow you to more efficiently do partition elimination, too.

But then it would be harder to tell whether a clause implied a given
partition. That is, if you have a partition constraint of "col OP const" then
we can test whether a query clause of "col OP2 const2" implies that constraint
when planning (or actually whether it implies it's false to exclude the
partition). If you have a constraint like "P1(const)" it'll be pretty hard to
do much with that.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas ADI SD 2007-03-08 10:22:08 Re: Auto creation of Partitions
Previous Message Magnus Hagander 2007-03-08 09:57:11 WSAStartup() in libpq

Browse pgsql-patches by date

  From Date Subject
Next Message Zeugswetter Andreas ADI SD 2007-03-08 10:22:08 Re: Auto creation of Partitions
Previous Message Simon Riggs 2007-03-08 08:47:32 Re: Auto creation of Partitions