Slow update SQL

From: Ken Hill <ken(at)scottshill(dot)com>
To: Postgres Help <pgsql-sql(at)postgresql(dot)org>
Subject: Slow update SQL
Date: 2006-02-14 01:48:45
Message-ID: 1139881725.3183.2.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm experiencing a very slow query. The table contains 611,564 rows of
data. I vaccumed the table:

VACUUM ANALYZE ncccr10;

SELECT count(*) FROM ncccr10;
count
--------
611564
(1 row)

When I try to analyze the query plan with:

EXPLAIN ANALYZE
UPDATE ncccr10
SET key = facilityno||'-'||
lastname||'-'||
sex||'-'||
ssno||'-'||
birthdate||'-'||
primarysit||'-'||
dxdate||'-'||
morphology3
WHERE date_part('year',dxdate) > '2000';

The query just never finishes (even 1 hour later). The colum key100 is
indexed, and I'm setting the value of this
column from other columns. Why is this so slow?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2006-02-14 02:14:34 Re: Slow update SQL
Previous Message Mark Fenbers 2006-02-14 00:14:47 group by complications