Re: Syntax for partitioning - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Syntax for partitioning
Date
Msg-id 87fwhp8y8x.fsf@hi-media-techno.com
Whole thread Raw
In response to Re: Syntax for partitioning  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> That said, I still don't see how you can enforce a unique index over
> multiple segments over something other than the partition key while
> still allowing quick dropping of segments.  If you can fix that you can
> make it work for the current inheritence-style partitioning.

Well the Primary Key and the Physical Map Index do not need to be on the
same set of columns.

>> If you happen to drop a part of the data that fits in one or more
>> segments (and with a decent fillfactor you need less than 1GB to get
>> there), then you can unlink() whole files at a time.  That would be the
>> goal here.
>
> I feel uncomfortable with the "happen to". You can add the magic too,
> but for scripting purposes I'd feel better if it could be done via DDL
> also. That way typos don't end up being 5 day queries all of a sudden.

If the data fills less than a segment then you can't unlink() the file,
you have to mark the tuples / pages as free space.  If you have a
partial index matching the whole portion of data you're removing, you
can still drop it before hand — or maybe the system can be instructed to
do so?

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Core Extensions relocation
Next
From: Robert Haas
Date:
Subject: Re: Core Extensions relocation