Hello pgdevs,

sorry if this has been already discussed, but G did not yield anything convincing about that.

While looking at HASH partitioning and creating a few ones, it occured to me that while RANGE and LIST partitions cannot be guessed easily, it would be easy to derive HASH partitioned table for a fixed MODULUS, e.g. with

  CREATE TABLE foo(...) PARTITION BY HASH AUTOMATIC (MODULUS 10);
  -- or some other syntax

Postgres could derive statically the 10 subtables, eg named foo_$0$ to foo_$1$.

That would not be a replacement for the feature where one may do something funny and doubtful like (MODULUS 2 REMAINDER 0, MODULUS 4 REMAINDER 1, MODULUS 4 REMAINDER 3).

The same declarative approach could eventually be considered for RANGE with a fixed partition duration and starting and ending points.

This would be a relief on the longer path of dynamically creating partitions, but with lower costs than a dynamic approach.

The ALTER thing would be a little pain.

Thoughts?

--
Fabien.


Reply via email to