Re: [GENERAL] indexed regex select optimisation missing?

Поиск
Список
Период
Сортировка
От Gene Selkov, Jr.
Тема Re: [GENERAL] indexed regex select optimisation missing?
Дата
Msg-id 199911040622.AAA23488@antares
обсуждение исходный текст
Ответ на indexed regex select optimisation missing?  (Stuart Woolford <stuartw@newmail.net>)
Ответы Re: [GENERAL] indexed regex select optimisation missing?  (Stuart Woolford <stuartw@newmail.net>)
Список pgsql-general
> select key from inv_word_i where word='whatever' order by count desc ;
>
> and this is fast, however, if I use:
>
> select key from inv_word_i where word~'^whatever.*' order by count desc ;
>
> it is very slow.

Did you try '^whatever' instead of '^whatever.*'? Based on common
sense, the former should be much faster than the latter, which would
match any cahracter any number of times, unless the regexp is
optimized to avoid that.

--Gene

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

Предыдущее
От: "Yury Don"
Дата:
Сообщение: Plpgsql qestion
Следующее
От: Roomi
Дата:
Сообщение: !!! Urgent: btree: lost page