Skip site navigation (1) Skip section navigation (2)

Re: slow full table update

From: tv(at)fuzzy(dot)cz
To: firerox(at)centrum(dot)cz
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: slow full table update
Date: 2008-11-10 16:41:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Sorry, but you have to provide much more information about the table. The
information you've provided is really not sufficient - the rows might be
large or small. I guess it's the second option, with a lots of dead rows.

Try this:

ANALYZE table;
SELECT relpages, reltuples FROM pg_class WHERE relname = 'table';

Anyway, is the autovacuum running? What are the parameters? Try to execute

VACUUM table;

and then run the two commands above. That might 'clean' the table and
improve the update performance. Don't forget each such UPDATE will
actually create a copy of all the modified rows (that's how PostgreSQL
works), so if you don't run VACUUM periodically or autovacuum demon, then
the table will bloat (occupy much more disk space than it should).

If it does not help, try do determine if the UPDATE is CPU or disk bound.
I'd guess there are problems with I/O bottleneck (due to the bloating).


> Hi,
> I have table with cca 60.000 rows and
> when I run query as:
>  Update table SET column=0;
> after 10 minutes i must stop query, but it still running :(
> I've Postgres 8.1 with all default settings in postgres.conf
> Where is the problem?
> Thak you for any tips.
> best regards.
> Marek Fiala
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:

In response to


pgsql-performance by date

Next:From: tvDate: 2008-11-10 17:12:22
Subject: Re: Simple indexed IN query takes 40 seconds
Previous:From: fireroxDate: 2008-11-10 16:30:28
Subject: slow full table update

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group