X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1E2BED6F73; Thu, 25 Aug 2005 15:50:42 -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 66557-03; Thu, 25 Aug 2005 18:50:39 +0000 (GMT) Received: from 217-20-115-93.internetserviceteam.com (217-20-115-93.internetserviceteam.com [217.20.115.93]) by svr1.postgresql.org (Postfix) with ESMTP id BF146D6F3F; Thu, 25 Aug 2005 15:50:35 -0300 (ADT) Received: from [192.168.1.121] (196.Red-83-42-225.pooles.rima-tde.net [83.42.225.196]) by 217-20-115-93.internetserviceteam.com (Postfix) with ESMTP id 290A4395AD; Thu, 25 Aug 2005 20:01:19 +0200 (CEST) Message-ID: <430E12F1.1080206@mediaroot.de> Date: Thu, 25 Aug 2005 19:50:25 +0100 From: Aldor User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Marc G. Fournier" Cc: pgsql-admin@postgresql.org Subject: Re: What is syslog:duration reporting ... ? References: <20050825152428.T1044@ganymede.hub.org> In-Reply-To: <20050825152428.T1044@ganymede.hub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200508/320 X-Sequence-Number: 18639 As I know EXPLAIN ANALYZE runs the query. I think you are just running the query two times. The first time you run the query it will take a long time to be processed - after the first run the query planner will remember the best way to run the query so your second run runs much faster. I can reproduce this behavior for some queries under 8.0.1 - so I'm not 100% sure if it is the same behavior under 7.4.2. I'm still wondering why you first query takes about 4107.987 ms - this kind of query has usually have to run much much faster. When did you vacuumed the table the last time? Marc G. Fournier wrote: > > 'k, I've been wracking my brains over this today, and I'm either > mis-understanding what is being reported *or* its reporting wrong ... > > According to syslog: > > LOG: duration: 4107.987 ms statement: UPDATE session SET > hit_time=now() WHERE md5='8b8e7b7ff9b1b2ed5fc60218ced28d00'; > > But, if I do an EXPLAIN ANALYZE: > > # explain analyze UPDATE session SET hit_time=now() WHERE > md5='702c6cb20d5eb254c3feb2991e7e5e31'; > QUERY PLAN > ---------------------------------------------------------------------------------------------------------------------------- > > Index Scan using session_md5_key on "session" (cost=0.00..6.01 rows=1 > width=93) (actual time=0.060..0.060 rows=0 loops=1) > Index Cond: (md5 = '702c6cb20d5eb254c3feb2991e7e5e31'::bpchar) > Total runtime: 0.171 ms > (3 rows) > > And it doesn't matter what value I put for md5, I still get <1ms ... > > I could see some variations, but almost 4000x slower to *really* run > the query vs an explain analyze? > > This is with 7.4.2 ... > > ---- > Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) > Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664 > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >