Re: UUID v1 optimizations...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: UUID v1 optimizations...
Дата
Msg-id 14074.1558821255@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: UUID v1 optimizations...  (Ancoron Luciferis <ancoron.luciferis@googlemail.com>)
Ответы Re: UUID v1 optimizations...  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Re: UUID v1 optimizations...  (Ancoron Luciferis <ancoron.luciferis@googlemail.com>)
Список pgsql-performance
Ancoron Luciferis <ancoron.luciferis@googlemail.com> writes:
> On 25/05/2019 16:57, Tom Lane wrote:
>> (4) it in fact *wouldn't* do anything useful, because we'd still have
>> to sort UUIDs in the same order as today, meaning that btree index behavior
>> would remain the same as before.  Plus UUID comparison would get a lot
>> more complicated and slower than it is now.

> I get your first sentence, but not your second. I know that when
> changing the internal byte order we'd have to completed re-compute
> everything on-disk (from table to index data), but why would the sorting
> in the index have to be the same?

Because we aren't going to change the existing sort order of UUIDs.
We have no idea what applications might be dependent on that.

As Vitalii correctly pointed out, your beef is not with the physical
storage of UUIDs anyway: you just wish they'd sort differently, since
that is what determines the behavior of a btree index.  But we aren't
going to change the sort ordering because that's an even bigger
compatibility break than changing the physical storage; it'd affect
application-visible semantics.

What you might want to think about is creating a function that maps
UUIDs into an ordering that makes sense to you, and then creating
a unique index over that function instead of the raw UUIDs.  That
would give the results you want without having to negotiate with the
rest of the world about whether it's okay to change the semantics
of type uuid.

            regards, tom lane



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

Предыдущее
От: Ancoron Luciferis
Дата:
Сообщение: Re: UUID v1 optimizations...
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: UUID v1 optimizations...