hot update doesn't work? - Mailing list pgsql-hackers

From Pavel Stehule
Subject hot update doesn't work?
Date
Msg-id AANLkTinmZQb5B1D5rRxEvGJp5qWdpbOjgJNDrggwBa8A@mail.gmail.com
Whole thread Raw
Responses Re: hot update doesn't work?
List 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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: max_standby_delay considered harmful
Next
From: Simon Riggs
Date:
Subject: Re: max_standby_delay considered harmful