Re: Multi-column index: Which column order

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Multi-column index: Which column order
Дата
Msg-id cb3e7d0d-82f8-086d-0e42-759e8dca56da@gmail.com
обсуждение исходный текст
Ответ на Re: Multi-column index: Which column order  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Multi-column index: Which column order  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general
On 2/15/23 21:45, Laurenz Albe wrote:
> On Wed, 2023-02-15 at 10:20 -0600, Ron wrote:
>> On 2/15/23 02:46, Laurenz Albe wrote:
[snip]
>>> Both are the same.
>>> There is an old myth that says that you should use the more selective column first
>>> (which would be "code"), but that is just a myth.
>> Only on Postgresql?
> No, on all relational databases that use B-tree indexes.

Not only is "all" is a very absolute word (I know of a counter-example), but 
querying on the second segment means that you have to scan the whole tree 
instead of isolating one sub-branch.

-- 
Born in Arizona, moved to Babylonia.



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Multi-column index: Which column order
Следующее
От: Mikhail Balayan
Дата:
Сообщение: Automatic aggressive vacuum on almost frozen table takes too long