X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 73BCB9DC820; Wed, 21 Dec 2005 07:25:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38035-01; Wed, 21 Dec 2005 07:26:00 -0400 (AST) X-Greylist: delayed 00:15:21.300719 by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailer.unicite.fr.netcentrex.net (mailer.fr.netcentrex.net [62.161.167.249]) by postgresql.org (Postfix) with ESMTP id A5E0E9DC80C; Wed, 21 Dec 2005 07:25:53 -0400 (AST) Received: from akira ([192.168.101.228]) by mailer.unicite.fr.netcentrex.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id Y7YLGJ07; Wed, 21 Dec 2005 12:10:34 +0100 From: "Alban Medici \(NetCentrex\)" To: , , Subject: Re: [PERFORM] need help Date: Wed, 21 Dec 2005 12:10:33 +0100 Organization: NetCentrex MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-reply-to: <439551D0.5070904@wildenhain.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Thread-Index: AcX6QtxBWcxHbcD6SaCfuFqV0+6GQgL3BwHQ Message-Id: <20051221112553.A5E0E9DC80C@postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.927 required=5 tests=[MSGID_FROM_MTA_ID=0.927] X-Spam-Score: 0.927 X-Spam-Level: X-Archive-Number: 200512/1015 X-Sequence-Number: 88578 Try to execute your query (in psql) with prefixing by EXPLAIN ANALYZE = and send us the result db=3D# EXPLAIN ANALYZE UPDATE s_apotik SET stock =3D 100 WHERE = obat_id=3D'A'; regards -----Original Message----- From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Tino = Wildenhain Sent: mardi 6 d=E9cembre 2005 09:55 To: Jenny Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-performance@postgresql.org Subject: Re: [PERFORM] [GENERAL] need help Jenny schrieb: > I'm running PostgreSQL 8.0.3 on i686-pc-linux-gnu (Fedora Core 2).=20 > I've been dealing with Psql for over than 2 years now, but I've never=20 > had this case before. >=20 > I have a table that has about 20 rows in it. >=20 > Table "public.s_apotik" > Column | Type | Modifiers > -------------------+------------------------------+------------------ > obat_id | character varying(10) | not null > stock | numeric | not null > s_min | numeric | not null > s_jual | numeric |=20 > s_r_jual | numeric |=20 > s_order | numeric |=20 > s_r_order | numeric |=20 > s_bs | numeric |=20 > last_receive | timestamp without time zone | > Indexes: > "s_apotik_pkey" PRIMARY KEY, btree(obat_id) > =20 > When I try to UPDATE one of the row, nothing happens for a very long = time. > First, I run it on PgAdminIII, I can see the miliseconds are growing=20 > as I waited. Then I stop the query, because the time needed for it is=20 > unbelievably wrong. >=20 > Then I try to run the query from the psql shell. For example, the=20 > table has obat_id : A, B, C, D. > db=3D# UPDATE s_apotik SET stock =3D 100 WHERE obat_id=3D'A'; (.... = nothing=20 > happens.. I press the Ctrl-C to stop it. This is what comes out > :) > Cancel request sent > ERROR: canceling query due to user request >=20 > (If I try another obat_id) > db=3D# UPDATE s_apotik SET stock =3D 100 WHERE obat_id=3D'B'; (Less = than a=20 > second, this is what comes out :) UPDATE 1 >=20 > I can't do anything to that row. I can't DELETE it. Can't DROP the = table.=20 > I want this data out of my database. > What should I do? It's like there's a falsely pointed index here. > Any help would be very much appreciated. >=20 1) lets hope you do regulary backups - and actually tested restore. 1a) if not, do it right now 2) reindex the table 3) try again to modify Q: are there any foreign keys involved? If so, reindex those tables too, just in case. did you vacuum regulary? HTH Tino ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq