Creating partitions automatically at least on HASH?
От | Fabien COELHO |
---|---|
Тема | Creating partitions automatically at least on HASH? |
Дата | |
Msg-id | alpine.DEB.2.21.1907150711080.22273@lancre обсуждение исходный текст |
Ответы |
Re: Creating partitions automatically at least on HASH?
|
Список | pgsql-hackers |
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.
В списке pgsql-hackers по дате отправления: