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

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Jonathan Reis <jon(dot)reis(at)conevity(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Olof Salberger <olof(dot)salberger(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18
Date: 2025-10-24 12:38:57
Message-ID: CAKAnmmKm_-Q0M=6puBCTO6eeSrgu1_Hkh4m5+WJKenorWoH2xg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Oct 23, 2025 at 10:14 PM Jonathan Reis <jon(dot)reis(at)conevity(dot)com>
wrote:

> Can't use pg_partman (this is true?)
>

Apologies, this warrants an explanation. It turns out I was wrong to be
concerned. I was worried about pg_partman being able to partition by the
decoded value of a column, but it already handles that quite well. From the
docs (where col3 is of type uuid):

SELECT partman.create_parent(
p_parent_table := 'partman_test.time_taptest_table'
, p_control := 'col3'
, p_interval := '1 day'
, p_time_encoder := 'partman.uuid7_time_encoder'
, p_time_decoder := 'partman.uuid7_time_decoder'
);

This also kind of answers your other question about your uuidv7_floor
function. While not native to Postgres, the uuid7_time_encoder function
used above is extremely similar to yours. See
https://github.com/pgpartman/pg_partman/blob/development/sql/functions/util_uuid7_time.sql

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jonathan Reis 2025-10-24 15:24:46 Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18
Previous Message Laurenz Albe 2025-10-24 05:04:16 Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18