Re: Do non-sequential primary keys slow performance significantly??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Do non-sequential primary keys slow performance significantly??
Дата
Msg-id 10481.1159508945@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Do non-sequential primary keys slow performance significantly??  ("Damian C" <jamianb@gmail.com>)
Список pgsql-novice
"Damian C" <jamianb@gmail.com> writes:
> In my ignorant bliss I would suspect that postgres will run more
> slowly using random primary keys.

More slowly compared to what?

If your performance bottleneck is concurrent insertions, random keys
should win over sequential keys because the insert load is distributed
over the whole index, leading to less page-level lock contention.
There might be other scenarios where sequential keys are better.

For a database servicing "only a few PCs" I'm not sure you should even
spend any time thinking about it --- do what's easiest for your
application code.

            regards, tom lane

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

Предыдущее
От: "Damian C"
Дата:
Сообщение: Do non-sequential primary keys slow performance significantly??
Следующее
От: Ray Stell
Дата:
Сообщение: Re: tablespace?