Re: Sequence vs UUID

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: veem v <veema0000(at)gmail(dot)com>, Miles Elam <miles(dot)elam(at)productops(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Sequence vs UUID
Date: 2023-01-30 16:48:43
Message-ID: 497565.1675097323@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne <ddevienne(at)gmail(dot)com> writes:
> On Mon, Jan 30, 2023 at 5:11 PM veem v <veema0000(at)gmail(dot)com> wrote:
>> CREATE TABLE test1_UUID ( id bigint,source_id varchar(36) PRIMARY KEY, Name varchar(20) );

> Maybe if you used a "native" 16-byte uuid, instead of its textual
> serialization with dashes (36 bytes + length overhead), the gap would
> narrow.

Yeah, especially if your database is not using C locale. The
strcoll or ICU-based comparisons done on string types can be
enormously more expensive than the memcmp() used for binary
types like native uuid.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2023-01-30 17:44:37 Re: How could I elog the tupleTableSlot to the fronted terminal?
Previous Message Dominique Devienne 2023-01-30 16:37:42 Re: Sequence vs UUID