pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ken Hill <ken@scottshill.com>
To: Postgres Help <pgsql-sql@postgresql.org>
Subject: Slow update SQL
Date: Mon, 13 Feb 2006 17:48:45 -0800
Message-ID: <1139881725.3183.2.camel@localhost.localdomain> (raw)

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? 

view thread (8+ messages)  latest in thread

Message-ID: <1139881725.3183.2.camel@localhost.localdomain>
Permalink:  ../1139881725.3183.2.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1139881725.3183.2.camel@localhost.localdomain

 · 

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-sql@postgresql.org
  Cc: ken@scottshill.com
  Subject: Re: Slow update SQL
  In-Reply-To: <1139881725.3183.2.camel@localhost.localdomain>

* 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