Re: Fetching multiple rows in single round trip

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Fetching multiple rows in single round trip
Дата
Msg-id jp83oa$g73$1@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Fetching multiple rows in single round trip  (Jon Smark <jon.smark@yahoo.com>)
Список pgsql-general
On 2012-05-18, Jon Smark <jon.smark@yahoo.com> wrote:

> I can think of two solutions:
>
> 1) "SELECT wid, data FROM widgets WHERE wid IN $targets"
> 2) "SELECT wid, data FROM widgets WHERE ARRAY [wid] <@ $targets"
>

my testing indicates that from 1 is significantly faster than from 2
postgres (8.4) cant factor "ARRAY[wid] <@"  sufficiently to see how it
can use an index to help find the answer where as it can understand
"wid IN" and use an index on wid to find the rows it needs.

--
⚂⚃ 100% natural

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

Предыдущее
От: "John Watts"
Дата:
Сообщение: Re: difference in query plan when db is restored
Следующее
От: "John Watts"
Дата:
Сообщение: Re: difference in query plan when db is restored