Re: UUIDs & Clustered Indexes

Поиск
Список
Период
Сортировка
От Luke Gordon
Тема Re: UUIDs & Clustered Indexes
Дата
Msg-id CAB47w9=1THHW5cayLMJDfKUicXUfpeXgkm4Tw0MSEUN3XDUi7A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: UUIDs & Clustered Indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom, 

Ah, that makes more sense.  Thank you very much!

On Tue, Aug 30, 2016 at 9:15 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Luke Gordon <gordysc@gmail.com> writes:
> However, according to a message on this mailing list, Postgres doesn't have
> clustered indexes:
> "But Postgres doesn't _have_ clustered indexes, so that article doesn't
> apply at all. The other authors appear to have missed this important point."
> https://www.postgresql.org/message-id/56798352.7060902%40uchicago.edu

> But, doing a quick check, it appears Postgres does indeed have a mechanism
> for a clustered index:
> https://www.postgresql.org/docs/9.5/static/sql-cluster.html

CLUSTER just does a one-time sort to put the table into index order.
There is no mechanism that would cause subsequent insertions of new keys
to respect that ordering, so it's pretty much irrelevant to the argument
about whether new UUID keys need to be generated in some ordered fashion.

Do you actually *need* UUID keys, and if so why?  A plain old bigint
column is smaller, cheaper to index, and the natural mechanism for
generating it (ie a sequence) will tend to preserve ordering for free.

                        regards, tom lane

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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: UUIDs & Clustered Indexes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: UUIDs & Clustered Indexes