How would I get information regarding update when running for a long time?

From: Chris Barnes <compuguruchrisbarnes(at)hotmail(dot)com>
To: Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: How would I get information regarding update when running for a long time?
Date: 2009-07-22 14:00:38
Message-ID: BLU149-W84F4C0079814EBD26FEBE7D41B0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I have an update that is comparing the id between two tables and inserting the value volume in the first table with result from second table.

I think I have two questions.

1) is this update expected to take this long?
2) is there something that I did wrong with the update causing this slow time?

Is there a way of determining the progress for the update?

If the update is taking this long (now 1.5 hours) is there something wrong with the update statement?

It seems a long time to compare and update the 20 million rows, or maybe not?

Are the adds for the indexes for volume on the first table making the update slow?

Here is the update and table definitions for both tables

update t1111 set volume=tchris.volume from tchris where t1111.id=tchris.id;

pgdb001=# select count(*) from dbprc001.t1111unadjusted_prices;
count
----------
19922778
(1 row)

pgdb001=# \d dbprc001.t1111unadjusted_prices
Table "dbprc001.t1111unadjusted_prices"
Column | Type | Modifiers
---------------+-----------------------+-----------
id | character varying(13) |
date | date |
price | numeric(18,6) |
volume | numeric(18,6) |
Indexes:
"ix_d111a" btree (id)
"ix_d111b" btree (date)
"ix_d111c" btree (price)
"ix_d111d" btree (volume)

pgdb001=# \d dbprc001.tchris
Table "dbprc001.tchris"
Column | Type | Modifiers
---------------+-----------------------+-----------
id | character varying(13) |
date | date |
volume | numeric(18,6) |
Indexes:
"ix_dchrisa" btree (id)
"ix_dchrisb" btree (date)
"ix_dchrisd" btree (volume)

Thanks for any help

Chris Barnes

_________________________________________________________________
More storage. Better anti-spam and antivirus protection. Hotmail makes it simple.
http://go.microsoft.com/?linkid=9671357

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tomrevam 2009-07-22 14:19:30 Re: Checkpoint Tuning Question
Previous Message Tom Lane 2009-07-22 12:50:17 Re: array_agg crash?