I don’t discuss here the choice itself but this is not correct:
create table mytable_z of mytable for values from ('Z') to ('Z[');
It should be
create table mytable_z of mytable for values from ('Z') to ('[')
Michel SALAIS
De : Nagaraj Raj <nagaraj.sf@yahoo.com> Envoyé : vendredi 21 mai 2021 18:39 À : David Rowley <dgrowleyml@gmail.com> Cc : Justin Pryzby <pryzby@telsasoft.com>; Pgsql-performance <pgsql-performance@postgresql.org> Objet : Re: Partition with check constraint with "like"
Hi David,
Hi,
I am trying to create partitions on the table which have around 2BIL records and users will always look for the "name", its not possible to create a partition with a list, so we are trying to create a partition-based first letter of the name column. name column has a combination of alpha numeric values.
You can also use MINVALUE and MAXVALUE to mean unbounded at either end of the range.
But is there a particular need that you want to partition this way? It seems like it might be a bit painful to maintain, especially if you're not limiting yourself to ASCII or ANSI characters.
You might want to consider HASH partitioning if you're just looking for a way to keep your tables and indexes to a more manageable size. You've not really mentioned your use case here, so it's hard to give any advice.