X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6BE40536F0 for ; Tue, 12 Apr 2005 12:03:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24814-04 for ; Tue, 12 Apr 2005 15:03:09 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by svr1.postgresql.org (Postfix) with ESMTP id A1821535AB for ; Tue, 12 Apr 2005 12:03:08 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 68so2970292wra for ; Tue, 12 Apr 2005 08:03:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=PWKgazxv/U77l8Im9miOWZqlbfTfefFkG2hwJWFIurHFuDn8UuPvYYtrF0RHPyJFaVYSQfSNNgA1RXZavSyUYW3D9CQwGWK7OowY/VQWV7TNLF/fBaw0y6uOn5P4T0GQc/ou8slzMrd+BN9uv/QLl8eHEl3iLUS9zrLMl31z0jk= Received: by 10.54.94.16 with SMTP id r16mr973344wrb; Tue, 12 Apr 2005 08:03:08 -0700 (PDT) Received: from ?10.80.1.43? ([194.248.208.82]) by mx.gmail.com with ESMTP id 12sm370546wrl.2005.04.12.08.03.07; Tue, 12 Apr 2005 08:03:08 -0700 (PDT) In-Reply-To: <15725.1113316540@sss.pgh.pa.us> References: <0201deb23790cee173bdd2d3f0e96642@gmail.com> <15725.1113316540@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4bbbc6d3a436e415be630d768d609ef6@gmail.com> Content-Transfer-Encoding: 7bit Cc: PostgreSQL Perform From: Bendik R.Johansen Subject: Re: Slow update Date: Tue, 12 Apr 2005 17:03:04 +0200 To: Tom Lane X-Mailer: Apple Mail (2.619.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.304 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/232 X-Sequence-Number: 11629 Hello, thank you for the quick reply. I am running version 8.0.1 Below is the schema for the table i will be using. I tried dropping the index, but it did not help. Table "no.records" Column | Type | Modifiers -------------+-------------------------- +------------------------------------------------------- id | integer | not null default nextval('"no".records_id_seq'::text) origid | integer | cid | character varying(16) | default ''::character varying category | integer[] | name | character varying(255) | not null default ''::character varying address | character varying(128) | street | character varying(127) | postalcode | integer | postalsite | character varying(64) | email | character varying(64) | website | character varying(64) | phone | character varying(16) | fax | character varying(16) | contact | character varying(64) | info | text | position | point | importid | integer | exportid | integer | created | timestamp with time zone | creator | integer | updated | timestamp with time zone | default ('now'::text)::timestamp(6) with time zone updater | integer | uid | integer | relevance | real | not null default 0 phonetic | text | uncertainty | integer | default 99999999 indexed | boolean | default false record | text | Indexes: "records_pkey" PRIMARY KEY, btree (id) "records_category_idx" gist (category) "records_cid_idx" btree (cid) "records_uid_idx" btree (uid) On Apr 12, 2005, at 16:35, Tom Lane wrote: > "Bendik R.Johansen" writes: >> I am having a bit of trouble updating a single integer column. >> My table has around 10 columns and 260 000 records. > >> update no.records set uid = 2; >> (uid is an integer. It has a btree index) > >> This update takes more than 20 minutes to execute. Is this normal? > > Takes about 20 seconds to update a table of that size on my machine... > > What PG version is this? We used to have some performance issues with > very large numbers of equal keys in btree indexes. Does dropping the > index make it faster? > > Are there foreign keys referencing this table from other tables? > > regards, tom lane >