pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedupdate performance 8.1.4
3+ messages / 3 participants
[nested] [flat]
* update performance 8.1.4
@ 2008-01-15 09:33 Thomas Markus <t.markus@proventis.net>
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Markus @ 2008-01-15 09:33 UTC (permalink / raw)
To: pgsql-admin
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!
Attachments:
t_markus.vcf (text/x-vcard, 253B) download
begin:vcard
fn:Thomas Markus
n:Markus;Thomas
org:proventis GmbH
adr:;;Zimmerstr. 79-80;Berlin;Berlin;10117;Germany
email;internet:t.markus@proventis.net
tel;work:+49 30 29 36 399 22
x-mozilla-html:FALSE
url:http://www.proventis.net
version:2.1
end:vcard
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: update performance 8.1.4
@ 2008-01-15 15:21 Scott Marlowe <scott.marlowe@gmail.com>
parent: Thomas Markus <t.markus@proventis.net>
1 sibling, 0 replies; 3+ messages in thread
From: Scott Marlowe @ 2008-01-15 15:21 UTC (permalink / raw)
To: Thomas Markus <t.markus@proventis.net>; +Cc: pgsql-admin
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?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: update performance 8.1.4
@ 2008-01-18 23:04 Kevin Grittner <Kevin.Grittner@wicourts.gov>
parent: Thomas Markus <t.markus@proventis.net>
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Grittner @ 2008-01-18 23:04 UTC (permalink / raw)
To: pgsql-admin; Thomas Markus <t.markus@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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2008-01-18 23:04 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-15 09:33 update performance 8.1.4 Thomas Markus <t.markus@proventis.net>
2008-01-15 15:21 ` Scott Marlowe <scott.marlowe@gmail.com>
2008-01-18 23:04 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
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