Re: Another weird one with an UPDATE

From: David Griffiths <dgriffiths(at)boats(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Another weird one with an UPDATE
Date: 2003-10-13 06:21:24
Message-ID: 098a01c39152$3e231c20$6501a8c0@griffiths2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Yes, the query operates only on indexed columns (all numeric(10)'s).

Column | Type |
Modifiers
-------------------------------+-----------------------------+--------------
---------------
user_account_id | numeric(10,0) | not null
[snip]
Indexes: user_account_pkey primary key btree (user_account_id),
Foreign Key constraints: $1 FOREIGN KEY (lang_id) REFERENCES lang(lang_id)
ON UPDATE NO ACTION ON DELETE NO ACTION,
$2 FOREIGN KEY (source_id) REFERENCES
source(source_id) ON UPDATE NO ACTION ON DELETE NO ACTION,
$3 FOREIGN KEY (user_role_id) REFERENCES
user_role(user_role_id) ON UPDATE NO ACTION ON DELETE NO ACTION

David

----- Original Message -----
From: "Joe Conway" <mail(at)joeconway(dot)com>
To: "David Griffiths" <dgriffiths(at)boats(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Sent: Sunday, October 12, 2003 6:37 PM
Subject: Re: [PERFORM] Another weird one with an UPDATE

> David Griffiths wrote:
> >>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)
>
> Do you have an index on user_account.user_account_id?
>
> Joe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message David Griffiths 2003-10-13 06:23:33 Re: Another weird one with an UPDATE
Previous Message pginfo 2003-10-13 05:01:26 Re: go for a script! / ex: PostgreSQL vs. MySQL