X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 52106DB0F5 for ; Thu, 27 Oct 2005 13:18:06 -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 03537-05 for ; Thu, 27 Oct 2005 16:18:04 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E9958DB0E7 for ; Thu, 27 Oct 2005 13:18:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j9RGI3UQ019723; Thu, 27 Oct 2005 12:18:03 -0400 (EDT) To: Denis Cc: pgsql-performance@postgresql.org Subject: Re: Update using primary key slow In-reply-to: References: Comments: In-reply-to Denis message dated "Thu, 27 Oct 2005 15:41:22 -0000" Date: Thu, 27 Oct 2005 12:18:03 -0400 Message-ID: <19722.1130429883@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/425 X-Sequence-Number: 15193 Denis writes: > The following update was captured in the database log and the elapsed time > was 1058.956 ms. A later explain analyze shows total run time of 730 ms. > Although isn't the actual time to update the row 183 ms. Where is the > other 547 ms coming from? Updating the two secondary indexes?? The 183 msec is the time needed to *fetch* the row, not the time to update it. So it could well be that the other time is just the time needed to update the table and indexes. If this seems slower than your hardware ought to be able to handle, I'd wonder about how recently the table has been vacuumed. regards, tom lane