Re: is it possible to get the optimizer to use indexes with a like clause

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: is it possible to get the optimizer to use indexes with a like clause
Дата
Msg-id m34qvxij9d.fsf@wolfe.cbbrowne.com
обсуждение исходный текст
Ответ на why do optimizer parameters have to be set manually?  ("Marinos J. Yannikos" <mjy@geizhals.at>)
Список pgsql-performance
pg@fastcrypt.com (Dave Cramer) wrote:
> It appears that the optimizer only uses indexes for = clause?

It can use indices only if there is a given prefix.

Thus:
   where text_field like 'A%'

can use the index, essentially transforming this into the clauses

   where text_field >= 'A' and
         text_field < 'B'.

You can't get much out of an index for
   where text_field like '%SOMETHING'
--
(reverse (concatenate 'string "moc.enworbbc" "@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/wp.html
"When the grammar checker identifies an error, it suggests a
correction and can even makes some changes for you."
-- Microsoft Word for Windows 2.0 User's Guide, p.35:

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: is it possible to get the optimizer to use indexes
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: is it possible to get the optimizer to use indexes