Re: [ADMIN] Q: Structured index - which one runs faster?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [ADMIN] Q: Structured index - which one runs faster?
Дата
Msg-id 11951.1053643980@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Q: Structured index - which one runs faster?  (Ernest E Vogelsinger <ernest@vogelsinger.at>)
Список pgsql-performance
Ernest E Vogelsinger <ernest@vogelsinger.at> writes:
> (a) creating an index on all three columns, or
> (b) create a single varchar column combining all three components into a
> single string, like "ident1:ident2:nodeid" and indexing this column only.

I can't imagine that (b) is a good idea ... it's dubious that you are
saving anything on the indexing, and you're sure adding a lot of space
to the table, not to mention maintenance effort, potential for bugs,
etc.

It might be worth creating the index so that the "least non-unique"
column is mentioned first, if there's a clear winner in those terms.
That would minimize the number of times that comparisons have to look at
the additional columns.

            regards, tom lane

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: [ADMIN] Q: Structured index - which one runs faster?
Следующее
От: Ernest E Vogelsinger
Дата:
Сообщение: Re: [ADMIN] Q: Structured index - which one runs faster?