Unix Technical Forum

update performance 8.1.4

This is a discussion on update performance 8.1.4 within the pgsql Admins forums, part of the PostgreSQL category; --> Hi, How can I speed up updates? i try an update tablename set datecol=null ~ 2.3 mio rows After ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:18 AM
Thomas Markus
 
Posts: n/a
Default update performance 8.1.4

Hi,

How can I speed up updates?
i try an
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

thanks
thomas






--
Thomas Markus

Tel: +49 30 29 36 399 - 22
Fax: +49 30 29 36 399 - 50
Mail: t.markus@proventis.net
Web: http://www.proventis.net
Web: http://www.blue-ant.de

proventis GmbH
Zimmerstraße 79-80
10117 Berlin

Geschäftsführer: Norman Frischmuth
Sitz: Berlin
Handelsregister: AG Berlin-Charlottenburg, HR 82917

We support your project business!



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:18 AM
Scott Marlowe
 
Posts: n/a
Default Re: update performance 8.1.4

2008/1/15 Thomas Markus <t.markus@proventis.net>:
> Hi,
>
> How can I speed up updates?
> i try an
> update tablename set datecol=null
> ~ 2.3 mio rows


Got any foreign keys against that table? If so, they need to be
indexed on the other end.

What's the schema of that table and any related tables?

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:18 AM
Kevin Grittner
 
Posts: n/a
Default Re: update performance 8.1.4

>>> 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




---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com