hot update doesn't work?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: hot update doesn't work?
Date: 2010-05-12 15:17:24
Message-ID: AANLkTinmZQb5B1D5rRxEvGJp5qWdpbOjgJNDrggwBa8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I would to repeatably update non indexed column of temp table. I
expected cheap operation, but it isn't true.

p ostgres=# create temp table x(a int primary key, b int);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"x_pkey" for table "x"
CREATE TABLE
Time: 363,339 ms
postgres=# insert into x values(1,0);
INSERT 0 1
Time: 11,676 ms
postgres=# create or replace function s1() returns void as $$ begin
for i in 1..100000 loop update x set b = i where a = 1; end loop;
return; end; $$ language plpgsql;
CREATE FUNCTION
Time: 113,052 ms
postgres=# select s1();
s1
----

(1 row)

Time: 255223,249 ms
postgres=# select pg_total_relation_size('x');
pg_total_relation_size
------------------------
3686400
(1 row)

the size of table was significantly increased :(.

what I doing wrong?

Regards
Pavel Stehule

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-05-12 15:28:13 Re: max_standby_delay considered harmful
Previous Message Simon Riggs 2010-05-12 14:40:19 Re: max_standby_delay considered harmful