Re: Speeding up subselect ?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Speeding up subselect ?
Дата
Msg-id 20020709103422.B29704@svana.org
обсуждение исходный текст
Ответ на Speeding up subselect ?  ("Peter Alberer" <h9351252@obelix.wu-wien.ac.at>)
Список pgsql-general
On Mon, Jul 08, 2002 at 06:10:05PM +0200, Peter Alberer wrote:
> Hi there,
>
> i have the following query in a pl/pgsql procedure:
>
>     update lr_object_usage
>     set status = (case status
>         when ''OPEN_SUCC'' then ''CLOSED_SUCC''
>         when ''OPEN_FAIL'' then ''CLOSED_FAIL'' end)
>     where lr_object_usage_id in (select lr_object_usage_id from
> lr_locked_objects where context = p_exam_usage_id);

Read the FAQ. Use EXISTS rather than IN.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.



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

Предыдущее
От: Darren Ferguson
Дата:
Сообщение: Re: Speeding up subselect ?
Следующее
От: Ricardo Junior
Дата:
Сообщение: Re: PostgreSQL doesn't use indexes even is enable_seqscan