Re: Partition with check constraint with "like"

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Partition with check constraint with "like"
Date: 2021-05-21 08:23:49
Message-ID: CAApHDvq1BkOqWjKPEtyrJ_Nj=3PuUAWw1S50U=apefu07_KuPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 21 May 2021 at 19:02, Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com> wrote:
> then what would be the range of Z
> FROM (Z) to (?) ;

postgres=# select chr(ascii('z')+1) ;
chr
-----
{
(1 row)

> same way for 9

postgres=# select chr(ascii('9')+1) ;
chr
-----
:
(1 row)

https://en.wikipedia.org/wiki/ASCII

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.

There are more details about partitioning in
https://www.postgresql.org/docs/current/ddl-partitioning.html

David

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Marc Millas 2021-05-21 12:41:31 logical replication
Previous Message Nagaraj Raj 2021-05-21 07:02:51 Re: Partition with check constraint with "like"