pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org
To: Thomas Markus <t.markus@proventis.net>
Subject: Re: update performance 8.1.4
Date: Fri, 18 Jan 2008 17:04:54 -0600
Message-ID: <4790DC36.EE98.0025.0@wicourts.gov> (raw)
In-Reply-To: <478C7DEC.1020806@proventis.net>
References: <478C7DEC.1020806@proventis.net>

>>> On Tue, Jan 15, 2008 at  3:33 AM, in message <478C7DEC.1020806@proventis.net>,
Thomas Markus <t.markus@proventis.net> wrote: 
 
>   update tablename set datecol=null
> ~ 2.3 mio rows
> 
> After 6 hours, this was still not finished. selects and inserts are ok.
> System is a dual xeon, 8gb ram, debian 64bit, pg 8.1.4
 
You do realize that every row updated is a delete and an insert,
right?  So this should take as long as a single database transaction
which deleted all the rows in the table and inserted them again.
 
If datecol is null in any rows, you should try:
 
update tablename set datecol=null where datecol is not null;
 
If you have canceled the update because of the long run time, you
will have left a lot of dead rows in the table, which will make the
next attempt run even longer.  Be sure you are doing vacuums.
 
-Kevin
 





view thread (3+ messages)

Message-ID: <4790DC36.EE98.0025.0@wicourts.gov>
Permalink:  ../4790DC36.EE98.0025.0@wicourts.gov/
Also on:    postgresql.org/message-id/4790DC36.EE98.0025.0@wicourts.gov

 · 

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-admin@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, t.markus@proventis.net
  Subject: Re: update performance 8.1.4
  In-Reply-To: <4790DC36.EE98.0025.0@wicourts.gov>

* 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