Re: Performance Concern

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: thebfh(at)toolsmythe(dot)com, john(at)pagakis(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance Concern
Date: 2003-10-27 10:08:49
Message-ID: 1fqppvc6j3jbj2ifsh2qaagdrtsl52gab8@email.aon.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, 26 Oct 2003 00:13:36 +0300, Hannu Krosing <hannu(at)tm(dot)ee> wrote:
>UPDATE baz
> SET customer_id = '1234'
> WHERE baz_key IN (
> SELECT baz_key
> FROM baz innerbaz
> WHERE customer_id IS NULL
> and innerbaz.baz_key = baz.baz_key
> LIMIT 1000 );

AFAICS this is not what the OP intended. It is equivalent to

UPDATE baz
SET customer_id = '1234'
WHERE customer_id IS NULL;

because the subselect is now correlated to the outer query and is
evaluated for each row of the outer query which makes the LIMIT clause
ineffective.

Servus
Manfred

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Christopher Browne 2003-10-27 12:52:06 Re: Various performance questions
Previous Message Neil Conway 2003-10-27 09:18:53 Re: explicit casting required for index use