Re: Query optimizer & prepared statements

Поиск
Список
Период
Сортировка
От Chris
Тема Re: Query optimizer & prepared statements
Дата
Msg-id 4A415F29.9020009@gmail.com
обсуждение исходный текст
Ответ на Query optimizer & prepared statements  (Jack Orenstein <jack.orenstein@hds.com>)
Список pgsql-general
Jack Orenstein wrote:
> If x is an integer column with an index, then
>
>     select ...
>     from T
>     where x > 1
>
> and
>
>     select ...
>     from T
>     where x > 1000000000
>
> could be optimized differently. So how is optimization done for a
> prepared statement containing a variable, e.g.
>
>     select ...
>     from T
>     where x > $1

http://www.postgresql.org/docs/current/static/sql-prepare.html#AEN58703
explains this.

If your parameter is a unique key, then you won't see any difference. If
your parameter is a non-unique key, there may be differences depending
on your data/distribution etc.

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


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

Предыдущее
От: raghu ram
Дата:
Сообщение: Re: [GENERAL] Error ::- “ 'more' is not recognized as an internal or external command, operable program or batch file. “
Следующее
От: Scott Mead
Дата:
Сообщение: Re: Controlling proliferation of postgres.exe processes