Re: Speeding up subselect ?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Peter Alberer <h9351252(at)obelix(dot)wu-wien(dot)ac(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Speeding up subselect ?
Date: 2002-07-09 00:34:22
Message-ID: 20020709103422.B29704@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rod Enke 2002-07-09 00:48:55 Re: Performance of ODBC-Driver /w IIS5.0/ColdFusion
Previous Message Matthew T. O'Connor 2002-07-09 00:30:37 Re: (A) native Windows port