Re: Auto creation of Partitions - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Auto creation of Partitions
Date
Msg-id 87wt1s6o35.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Auto creation of Partitions  (Jim Nasby <decibel@decibel.org>)
Responses Re: Auto creation of Partitions  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-hackers
"Jim Nasby" <decibel@decibel.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


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: WSAStartup() in libpq
Next
From: "Zeugswetter Andreas ADI SD"
Date:
Subject: Re: Auto creation of Partitions