Re: Syntax for partitioning

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martijn van Oosterhout <kleptog@svana.org>
Cc: Dimitri Fontaine <dimitri@2ndQuadrant.fr>, Jeff Janes <jeff.janes@gmail.com>, Thom Brown <thom@linux.com>, Robert Haas <robertmhaas@gmail.com>, Jaime Casanova <jaime@2ndquadrant.com>, Simon Riggs <simon@2ndquadrant.com>, Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>, pgsql-hackers@postgresql.org, Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>, Itagaki Takahiro <itagaki.takahiro@gmail.com>
Date: 2011-11-12T16:28:32Z
Lists: pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> While I agree that explicit partitioning is somewhat of a hack, it's a
> really useful hack.  But for me the most important use of partitioning
> is "dropping a billion rows efficiently and getting the disk space
> back".

Right.  The only way to make that speedy is for the partition boundaries
to match the desired granularity of data removal.  I don't really see
any way that the database can be expected to know what that is, unless
it's told in advance.  So AFAICS you really have to have a declarative
way of telling it how to do the partitioning --- it's not going to be
able to infer that automatically.

			regards, tom lane