Re: Mass updates on a large table - Mailing list pgsql-admin

From Tom Lane
Subject Re: Mass updates on a large table
Date
Msg-id 11247.1186770051@sss.pgh.pa.us
Whole thread Raw
In response to Mass updates on a large table  ("Mark Steben" <msteben@autorevenue.com>)
List pgsql-admin
"Mark Steben" <msteben@autorevenue.com> writes:
> I am attempting an update on two new date field columns on a 17 million row
> table.  Every row gets updated.
> The update statement is a simple one:
>   UPDATE EMAILRCPTS SET ID = ID
>  And the update of the new date fields themselves occurs as the result of a
> before trigger.

When you don't show us the trigger, it's hard to make any useful
comment ... but 60 rows/second seems slow enough to suspect that the
trigger is very inefficient.

> There are about 9 indexes on this table although none of them reference the
> date fields so since there are no inserts I don't think they would have an
> impact on the update  (I've been wrong before though)

And you are again ... but still, it's awfully slow.

> We are at Postgres 7.4.5.

That's a big problem right there.  One thing I can tell you is that it
is sheer folly to set shared_buffers so high on PG 7.x.  It wasn't till
about 8.1 that we had buffer management algorithms that were good enough
for lots of buffers.  Dial it down to something under 100K buffers.  And
think about an update.  At the very least you should be on a far more
current 7.4.x release.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Mass updates on a large table
Next
From: "Scott Marlowe"
Date:
Subject: Re: Mass updates on a large table