Re: updates (postgreSQL) very slow - Mailing list pgsql-general

From Tom Lane
Subject Re: updates (postgreSQL) very slow
Date
Msg-id 16835.1078988475@sss.pgh.pa.us
Whole thread Raw
In response to Re: updates (postgreSQL) very slow  (Fred Moyer <fred@redhotpenguin.com>)
Responses Re: updates (postgreSQL) very slow
List pgsql-general
Fred Moyer <fred@redhotpenguin.com> writes:
> On Wed, 2004-03-10 at 15:30, Tom Lane wrote:
>> A while, sure, but 2 hours seems excessive to me too.

> If there are no foreign keys or triggers and updating each row is taking
> one drive seek ( approximately 9 ms with the 80 gig IDE drive being used
> here ) then to do 747524 seeks will take 6727716 ms, about 10% less than
> the time of 7628686 ms for the update above.  Is this is an accurate
> estimate or are these numbers just coincidence?

Probably coincidence.  There's no reason to think that a large UPDATE
would expend one disk seek per updated row on average --- there's enough
buffering between the UPDATE and the drive heads that under normal
circumstances the cost should be lots less.

If I had to bet at this point I'd bet on inefficient foreign-key checks,
but since we haven't seen any schema details that's purely speculation.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_aggregate weird stuff
Next
From: "Bobbie van der Westhuizen"
Date:
Subject: Re: updates (postgreSQL) very slow