Re: Functional index and string concatenation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Functional index and string concatenation
Дата
Msg-id 4125.1078760915@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Functional index and string concatenation  (Edmund Bacon <ebacon@onesystem.com>)
Список pgsql-sql
Edmund Bacon <ebacon@onesystem.com> writes:
> On Mon, 2004-03-08 at 08:19, Daniel Henrique Alves Lima wrote:
>> Is there a way to create a "functional index" over a string 
>> concatenation of two columns ?

> test=# create index str_idx on strtable( textcat(str1, str2) );

As of 7.4 you can do it more directly:

create index str_idx on strtable( (str1 || str2) );

The disadvantage of the textcat() locution is that the planner will only
match it up to queries that also say textcat().
        regards, tom lane


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

Предыдущее
От: Edmund Bacon
Дата:
Сообщение: Re: Functional index and string concatenation
Следующее
От: Daniel Henrique Alves Lima
Дата:
Сообщение: Re: Functional index and string concatenation