Re: Prepared statements considered harmful

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Prepared statements considered harmful
Дата
Msg-id 200608311549.22228.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: Prepared statements considered harmful  (Csaba Nagy <nagy@ecircle-ag.com>)
Ответы Re: Prepared statements considered harmful
Список pgsql-hackers
Am Donnerstag, 31. August 2006 15:36 schrieb Csaba Nagy:
> On Thu, 2006-08-31 at 15:19, Peter Eisentraut wrote:
> > OK, why don't you work out an example.  Let's look at this query:
> >
> > SELECT * FROM t1 WHERE a LIKE $1;
> >
> > What two plans would you prepare?
>
> if substring($1 from 1 for 1) != '%' then
>   use plan 1 (see below);
> else
>   use plan 2 (see below);
> end if;

Note that plan 1 can only be created if you know the actual value for $1.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


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

Предыдущее
От: stark
Дата:
Сообщение: GUC settings with units broken?
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: Prepared statements considered harmful