pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: veem v <veema0000@gmail.com>
Cc: Miles Elam <miles.elam@productops.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Sequence vs UUID
Date: Mon, 30 Jan 2023 11:48:43 -0500
Message-ID: <497565.1675097323@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-8akNRqG2JzFtwpz9YgGMQB9nabkrhj2+=MLkbLhb4k_Q@mail.gmail.com>
References: <CAB+=1TXUHPFzhn8iZyVBzJM_YPR4RJAqrd-Ek=V1MK=sUJQrHA@mail.gmail.com>
	<214765350.744944.1674770109151@office.mailbox.org>
	<9864e7fa-27c7-95ac-b9a7-e1ebc4824740@gmail.com>
	<1015127885.422245.1674938371999@office.mailbox.org>
	<CAD+mzoy0tPKf5+z8KsiFcXsPLE021fTbS7m-POFX8qv-N+M2_Q@mail.gmail.com>
	<b7428272-37a0-aa8b-4b84-ebc888e31b0a@gmail.com>
	<CAALojA98Jf6M1NFmKy5qqOyydU6-eCNE8rY2Yg+W+Qp9P0jqDA@mail.gmail.com>
	<c140b8ee-941b-383a-986d-de1b924a0b65@gmail.com>
	<CAALojA_+ar2YQcB7u+LGXEO_6P9j=Me-XQhMUvALa+=rYSGzXQ@mail.gmail.com>
	<CAB+=1TUfSKKU7pWOGgJdQBcB4vLECkxRsF_jf5vyJ6pq-U-p=w@mail.gmail.com>
	<CAB+=1TV9gpAA-cGt_AShCmMA9fiu9jAa4egZF+oMELApOz-JYQ@mail.gmail.com>
	<CAFCRh-8akNRqG2JzFtwpz9YgGMQB9nabkrhj2+=MLkbLhb4k_Q@mail.gmail.com>

Dominique Devienne <ddevienne@gmail.com> writes:
> On Mon, Jan 30, 2023 at 5:11 PM veem v <veema0000@gmail.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





view thread (46+ messages)  latest in thread

Message-ID: <497565.1675097323@sss.pgh.pa.us>
Permalink:  ../497565.1675097323@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/497565.1675097323@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ddevienne@gmail.com, veema0000@gmail.com, miles.elam@productops.com
  Subject: Re: Sequence vs UUID
  In-Reply-To: <497565.1675097323@sss.pgh.pa.us>
  References: <CAB+=1TXUHPFzhn8iZyVBzJM_YPR4RJAqrd-Ek=V1MK=sUJQrHA@mail.gmail.com> <214765350.744944.1674770109151@office.mailbox.org> <9864e7fa-27c7-95ac-b9a7-e1ebc4824740@gmail.com> <1015127885.422245.1674938371999@office.mailbox.org> <CAD+mzoy0tPKf5+z8KsiFcXsPLE021fTbS7m-POFX8qv-N+M2_Q@mail.gmail.com> <b7428272-37a0-aa8b-4b84-ebc888e31b0a@gmail.com> <CAALojA98Jf6M1NFmKy5qqOyydU6-eCNE8rY2Yg+W+Qp9P0jqDA@mail.gmail.com> <c140b8ee-941b-383a-986d-de1b924a0b65@gmail.com> <CAALojA_+ar2YQcB7u+LGXEO_6P9j=Me-XQhMUvALa+=rYSGzXQ@mail.gmail.com> <CAB+=1TUfSKKU7pWOGgJdQBcB4vLECkxRsF_jf5vyJ6pq-U-p=w@mail.gmail.com> <CAB+=1TV9gpAA-cGt_AShCmMA9fiu9jAa4egZF+oMELApOz-JYQ@mail.gmail.com> <CAFCRh-8akNRqG2JzFtwpz9YgGMQB9nabkrhj2+=MLkbLhb4k_Q@mail.gmail.com> <497565.1675097323@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox