Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18
Дата
Msg-id cc128c674065c06ebc0d1eb5e76fa2598e78c1c9.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18  (Jonathan Reis <jon.reis@conevity.com>)
Ответы Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18
Список pgsql-performance
On Thu, 2025-10-23 at 13:11 -0700, Jonathan Reis wrote:
> Thank you very much for your recommendations and your sample code. I originally had it your way, but then I found out
thisis not possible 
>
> create table message (
>   id uuid PRIMARY KEY
>   -- ... plus other columns
> ) partition by range (uuid_extract_timestamp(id));

That's because you want to make "id" a primary key, but you can only create a primary
key constraint on a partitioned table if the partitioning key is a subset of the
primary key.

I recommend that you create a primary key on each partition rather than having one
on the partitioned table.

Yours,
Laurenz Albe



В списке pgsql-performance по дате отправления: