Re: query planner: automatic rescribe of LIKE to BETWEEN ?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: query planner: automatic rescribe of LIKE to BETWEEN ?
Дата
Msg-id 20060822174539.GD25475@alvh.no-ip.org
обсуждение исходный текст
Ответ на query planner: automatic rescribe of LIKE to BETWEEN ?  (Ulrich Habel <espero7757@gmx.net>)
Ответы Re: query planner: automatic rescribe of LIKE to BETWEEN ?
Список pgsql-performance
Ulrich Habel wrote:
> Hello all,
> had an idea of optimizing a query that may work generally.
>
> In case a 'column' is indexed, following two alterations could be done
> I think:
>
> A)
>
>   select ... where column ~ '^Foo'     -->  Seq Scan

This is not true.  You can make this query use an index if you create it
with opclass varchar_pattern_ops or text_pattern_ops, as appropiate.

Thus you don't need any hack here.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: Ulrich Habel
Дата:
Сообщение: query planner: automatic rescribe of LIKE to BETWEEN ?
Следующее
От: "Thomas Samson"
Дата:
Сообщение: Re: query planner: automatic rescribe of LIKE to BETWEEN ?