Re: Regex query not using index

Поиск
Список
Период
Сортировка
От Chris
Тема Re: Regex query not using index
Дата
Msg-id 47BBBBDE.1090901@gmail.com
обсуждение исходный текст
Ответ на Re: Regex query not using index  ("Postgres User" <postgres.developer@gmail.com>)
Ответы Re: Regex query not using index
Re: Regex query not using index
Список pgsql-general
Postgres User wrote:
> Yes that works, but the whole point of the exercise is replace many OR
> statements with 1 regex expression.  So it's not what I'm looking for.

Why do you want it done this way?

You can build an array of strings to check and use an in clause.

Using php :

$checks = array('AA', 'BA');

$query = "select * from table where name in ('" . implode("','",
$checks) . "')";

and it should use an index (up to a point anyway).

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Предыдущее
От: "Postgres User"
Дата:
Сообщение: Re: Regex query not using index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: