Re: Regex query not using index

Поиск
Список
Период
Сортировка
Искать
От
Postgres User
Тема
Re: Regex query not using index
Дата
Msg-id
b88c3460802192143y7e4c949ahf117502d51508509@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Erik Jones <erik@myemma.com>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Chris <dmagick@gmail.com>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Tom Lane <tgl@sss.pgh.pa.us>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Martijn van Oosterhout <kleptog@svana.org>
Re: Regex query not using index Chris <dmagick@gmail.com>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Tino Wildenhain <tino@wildenhain.de>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Tom Lane <tgl@sss.pgh.pa.us>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: Regex query not using index "Postgres User" <postgres.developer@gmail.com>
Re: Regex query not using index Chris <dmagick@gmail.com>
im trying to allow the client to pass a varchar param into my
function, and want to avoid any parsing of the parameter inside the
function, or code to build a sql string.

if the function can use this code, it will be compiled and optimized
(unlike a dynamic sql stirng)

select * from mytable where fielda ~ p_param

(where p_param is the input parameter)

On Feb 19, 2008 9:34 PM, Chris  wrote:
> 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 по дате отправления
От: Tom Lane
Дата:
Сообщение: Re:
От: Tom Lane
Дата:
FAQ