Re: [PERFORM] update query taking too long

2007-06-28 Thread Richard Huxton
Jean-David Beyer wrote: Chris wrote (in part): I didn't have logging set up before but it's up and running now and I was getting LOG: checkpoints are occurring too frequently (26 seconds apart) HINT: Consider increasing the configuration parameter "checkpoint_segments". So I increased that

Re: [PERFORM] update query taking too long

2007-06-28 Thread Heikki Linnakangas
Jean-David Beyer wrote: I have not used postgreSQL since I tried it once in about 1998 (when I found it unsatisfactory, but much has changed since then), but I am going to try it again. What would be a good checkpointing interval? I would guess 26 seconds is too often. What considerations go into

Re: [PERFORM] update query taking too long

2007-06-28 Thread Jean-David Beyer
Chris wrote (in part): > I didn't have logging set up before but it's up and running now and I > was getting > > LOG: checkpoints are occurring too frequently (26 seconds apart) > HINT: Consider increasing the configuration parameter > "checkpoint_segments". > > So I increased that from 10 to

Re: [PERFORM] update query taking too long

2007-06-28 Thread Chris
Richard Huxton wrote: Chris wrote: db=# UPDATE email_upd_test SET domainname=substring(email from position('@' in email)); UPDATE 100 Time: 43796.030 ms I think I'm I/O bound from my very limited understanding of vmstat. Well, 43 seconds to update 1 million rows suggests your real query

Re: [PERFORM] update query taking too long

2007-06-28 Thread Richard Huxton
Chris wrote: db=# UPDATE email_upd_test SET domainname=substring(email from position('@' in email)); UPDATE 100 Time: 43796.030 ms I think I'm I/O bound from my very limited understanding of vmstat. Well, 43 seconds to update 1 million rows suggests your real query should be complete in

Re: [PERFORM] update query taking too long

2007-06-27 Thread Chris
Richard Huxton wrote: Chris wrote: Tom Lane wrote: Any foreign keys leading to or from that table? Nope :( 3.5 million row updates are not exactly gonna be instantaneous anyway, but only FK checks or really slow user-written triggers would make it take upwards of an hour ... No triggers,

Re: [PERFORM] update query taking too long

2007-06-27 Thread Richard Huxton
Chris wrote: Tom Lane wrote: Any foreign keys leading to or from that table? Nope :( 3.5 million row updates are not exactly gonna be instantaneous anyway, but only FK checks or really slow user-written triggers would make it take upwards of an hour ... No triggers, functions. Of course

Re: [PERFORM] update query taking too long

2007-06-27 Thread Chris
A. Kretschmer wrote: am Thu, dem 28.06.2007, um 16:16:50 +1000 mailte Chris folgendes: Is there a better way to write the update? I thought about something like this (but couldn't get it working - guess I don't have the right syntax): update t1 set domainname=(select id, SUBSTRING(emailaddre

Re: [PERFORM] update query taking too long

2007-06-27 Thread A. Kretschmer
am Thu, dem 28.06.2007, um 16:16:50 +1000 mailte Chris folgendes: > Is there a better way to write the update? I thought about something > like this (but couldn't get it working - guess I don't have the right > syntax): > > update t1 set domainname=(select id, SUBSTRING(emailaddress FROM > POS

Re: [PERFORM] update query taking too long

2007-06-27 Thread Chris
A. Kretschmer wrote: am Thu, dem 28.06.2007, um 15:03:32 +1000 mailte Chris folgendes: Hi all, I'm trying to do an update of a reasonably large table and it's taking way too long so I'm trying to work out why and if I need to tweak any settings to speed it up. The table is around 3.5 milli

Re: [PERFORM] update query taking too long

2007-06-27 Thread Chris
Tom Lane wrote: Chris <[EMAIL PROTECTED]> writes: I'm trying to do an update of a reasonably large table and it's taking way too long so I'm trying to work out why and if I need to tweak any settings to speed it up. Any foreign keys leading to or from that table? Nope :( 3.5 million row u

Re: [PERFORM] update query taking too long

2007-06-27 Thread Tom Lane
Chris <[EMAIL PROTECTED]> writes: > I'm trying to do an update of a reasonably large table and it's taking > way too long so I'm trying to work out why and if I need to tweak any > settings to speed it up. Any foreign keys leading to or from that table? 3.5 million row updates are not exactly g

Re: [PERFORM] update query taking too long

2007-06-27 Thread A. Kretschmer
am Thu, dem 28.06.2007, um 15:03:32 +1000 mailte Chris folgendes: > Hi all, > > I'm trying to do an update of a reasonably large table and it's taking > way too long so I'm trying to work out why and if I need to tweak any > settings to speed it up. > > The table is around 3.5 million records.

[PERFORM] update query taking too long

2007-06-27 Thread Chris
Hi all, I'm trying to do an update of a reasonably large table and it's taking way too long so I'm trying to work out why and if I need to tweak any settings to speed it up. The table is around 3.5 million records. The query is update table set domainname=substring(emailaddress from positio