Re: Massive table (500M rows) update nightmare

From: Ludwik Dylag <ldylag(at)gmail(dot)com>
To: Leo Mannhart <leo(dot)mannhart(at)beecom(dot)ch>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Massive table (500M rows) update nightmare
Date: 2010-01-07 16:38:26
Message-ID: 2fe468a21001070838n40f1cbb5y19b34c5c4748a62d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I would suggest:
1. turn off autovacuum
1a. ewentually tune db for better performace for this kind of operation
(cant not help here)
2. restart database
3. drop all indexes
4. update
5. vacuum full table
6. create indexes
7. turn on autovacuum

Ludwik

2010/1/7 Leo Mannhart <leo(dot)mannhart(at)beecom(dot)ch>

> Kevin Grittner wrote:
> > Leo Mannhart <leo(dot)mannhart(at)beecom(dot)ch> wrote:
> >
> >> You could also try to just update the whole table in one go, it is
> >> probably faster than you expect.
> >
> > That would, of course, bloat the table and indexes horribly. One
> > advantage of the incremental approach is that there is a chance for
> > autovacuum or scheduled vacuums to make space available for re-use
> > by subsequent updates.
> >
> > -Kevin
> >
>
> ouch...
> thanks for correcting this.
> ... and forgive an old man coming from Oracle ;)
>
> Leo
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

--
Ludwik Dyląg

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2010-01-07 16:57:59 Re: Massive table (500M rows) update nightmare
Previous Message Craig James 2010-01-07 16:31:25 Re: Air-traffic benchmark