pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Griffiths <dgriffiths@boats.com>
To: pgsql-performance@postgresql.org
Subject: Re: Another weird one with an UPDATE
Date: Sun, 12 Oct 2003 18:33:54 -0700
Message-ID: <080d01c3912a$1356dea0$6501a8c0@griffiths2> (raw)
References: <052001c39030$1ccc8020$6501a8c0@griffiths2>
	<05a401c3903f$a8524850$6501a8c0@griffiths2>
	<20031011153251.F57866@megazone.bigpanda.com>

[snip]

> I think you want something like:
> UPDATE user_account SET last_name = 'abc'
>  WHERE EXISTS (SELECT 1 FROM commercial_entity ce, commercial_service cs
>  WHERE user_account.user_account_id = ce.user_account_id AND
>  ce.commercial_entity_id = cs.commercial_entity_id);

Unfort, this is still taking a long time.

----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------
 Seq Scan on user_account  (cost=0.00..748990.51 rows=36242 width=716)
(actual time=10262.50..26568.03 rows=3771 loops=1)
   Filter: (subplan)
   SubPlan
     ->  Nested Loop  (cost=0.00..11.47 rows=1 width=24) (actual
time=0.24..0.24 rows=0 loops=72483)
           ->  Index Scan using comm_ent_usr_acc_id_i on commercial_entity
ce  (cost=0.00..4.12 rows=1 width=12) (actual time=0.05..0.05 rows=0
loops=72483)
                 Index Cond: ($0 = user_account_id)
           ->  Index Scan using comm_serv_comm_ent_id_i on
commercial_service cs  (cost=0.00..7.32 rows=3 width=12) (actual
time=1.72..1.72 rows=0 loops=7990)
                 Index Cond: ("outer".commercial_entity_id =
cs.commercial_entity_id)
 Total runtime: 239585.09 msec
(9 rows)

Anyone have any thoughts?

David



view thread (12+ messages)  latest in thread

Message-ID: <080d01c3912a$1356dea0$6501a8c0@griffiths2>
Permalink:  ../080d01c3912a$1356dea0$6501a8c0@griffiths2/
Also on:    postgresql.org/message-id/080d01c3912a$1356dea0$6501a8c0@griffiths2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dgriffiths@boats.com
  Subject: Re: Another weird one with an UPDATE
  In-Reply-To: <080d01c3912a$1356dea0$6501a8c0@griffiths2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox