Re: [SQL] Prepared Statements and large where-id-in constant blocks?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] Prepared Statements and large where-id-in constant blocks?
Дата
Msg-id 2046.1082422958@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Prepared Statements and large where-id-in constant blocks?  (James Robinson <jlrobins@socialserve.com>)
Список pgsql-jdbc
James Robinson <jlrobins@socialserve.com> writes:
> where there may be anywhere between 1 and thousands of "(id = N)"
> blocks ORed together. These may be transformed to the "WHERE t1.id IN
> (X, Y, ...)" form for possibly a little performance gain (possibly --
> I've not yet checked to see if this plans better than the other, but I
> could imagine this form being parsed into the hashjoin form as opposed
> to a huge index filter form).

There is *no difference whatever*; in fact the PG parser expands an IN
clause into an OR'd list.

Possibly this is something to improve someday, but there's surely no
percentage in doing lots of work in the JDBC driver to prefer the IN
form at the moment.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: EXECUTE command tag returns actual command
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Prepared Statements and large where-id-in constant blocks?