slow update

From: Lionel Barth <lbarth(at)hachette-livre(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: slow update
Date: 1998-10-16 15:21:45
Message-ID: 36276486.5BB2B057@hachette-livre.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I use a Postgres 6.3.2 whith the btree_adj-980730 patch on a Sun
UltraSparc 1 under Solaris 2.5.1

I create a table

CREATE TABLE dlf (lft int4 NOT NULL, id varchar(20), rgt int4 NOT NULL,
niv int4, tag varchar(32), type varchar(32));

I feed the table with about 5600 tuples

COPY dlf FROM '....../dlf.import';

I create an index

CREATE INDEX dlf_lft_index on dlf using btree (lft int4_ops );

I make updates

explain update dlf set lft = lft+2 where lft>7;
Index Scan on dlf (cost=119.50 size=1870 width=54)
Why is the update so slow?

explain update dlf set lft = lft+2;
Seq Scan on dlf (cost=244.13 size=5610 width=54)
Why do I have a Seq Scan instead of an Index Scan?

vacuum dlf;

explain update dlf set lft = lft+2 where lft>7;
Index Scan on dlf (cost=151.53 size=1871 width=54)

explain update dlf set lft = lft+2;
Seq Scan on dlf (cost=244.20 size=5612 width=54)
Why are the updates slower after the vacuum?

Thank you
Lionel Barth

Browse pgsql-general by date

  From Date Subject
Next Message Dustin Sallings 1998-10-16 17:55:53 Index problem.
Previous Message Sferacarta Software 1998-10-16 12:53:19 Re: [GENERAL] v6.4-BETA2 Compile error