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

Re: pessimal trivial-update performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pessimal trivial-update performance
Date: 2010-07-04 04:11:19
Message-ID: 26947.1278216679@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> CREATE OR REPLACE FUNCTION update_tab() RETURNS void AS $$
> BEGIN
> 	INSERT INTO tab VALUES (0);
> 	FOR i IN 1..100000 LOOP
> 		UPDATE tab SET x = x + 1;
> 	END LOOP;
> END
> $$ LANGUAGE plpgsql;

I believe that none of the dead row versions can be vacuumed during this
test.  So yes, it sucks, but is it representative of real-world cases?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2010-07-04 04:17:32
Subject: Re: pessimal trivial-update performance
Previous:From: Robert HaasDate: 2010-07-04 04:05:45
Subject: pessimal trivial-update performance

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