bind variables, soft vs hard parse

Поиск
Список
Период
Сортировка
От Marcus Engene
Тема bind variables, soft vs hard parse
Дата
Msg-id 437A2A0A.6050104@engene.se
обсуждение исходный текст
Ответы Re: bind variables, soft vs hard parse  (Douglas McNaught <doug@mcnaught.org>)
Re: bind variables, soft vs hard parse  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
Hi list.

I've mostly used Oracle in the past, but for a web-project I took the 
opportunity to try Postgres.

When a select is done in Oracle, it first checks if the select is cached 
(ie parsed tree, optimizer choices & such). It does this by 
[functionality equal to] a byte to byte compare with the other sql strings.

select a from b where c = 1
select a from b where c = 2

...will thus force a hard parse on the second select. But if using bind 
variables it wont as the string stored is something like

select a from b where c = ?

Which will be the same as the second call. There is quite a big 
difference in performance using bind variables.

Does Postgres work the same? Where can I go for more info?

Oracle recently gave some money to Zend to make proper Oracle support 
for PHP. In that interface they use bind variables. Apart from greater 
speed, sqlinjection becomes history as well.

Best regards,
Marcus



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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: MERGE vs REPLACE
Следующее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: MERGE vs REPLACE