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 88FB314B2820 for ; Thu, 12 Aug 2004 08:16:30 -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 62090-09 for ; Thu, 12 Aug 2004 11:16:27 +0000 (GMT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id B49E914B280B for ; Thu, 12 Aug 2004 08:16:25 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 1BvDZL-00002N-0W; Thu, 12 Aug 2004 11:16:27 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id B4871183A8; Thu, 12 Aug 2004 12:16:23 +0100 (BST) Message-ID: <411B5184.6090106@archonet.com> Date: Thu, 12 Aug 2004 12:16:20 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ulrich Wisser Cc: pgsql-performance@postgresql.org, bruno@wolff.to Subject: Re: [GENERAL] How to know which queries are to be optimised? References: <4110CFE7.9000202@relevanttraffic.se> <20040811162701.GA9992@wolff.to> <411B4878.4090804@relevanttraffic.se> In-Reply-To: <411B4878.4090804@relevanttraffic.se> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/185 X-Sequence-Number: 7821 Ulrich Wisser wrote: >> You can log queries that run for at least a specified amount of time. >> This will be useful in finding what the long running queries are. >> You can then use explain analyse to see why they are long running. > > But is there a tool that could compile a summary out of the log? The log > grows awefully big after a short time. You might want to look at the "Practical Query Analyser" - haven't used it myself yet, but it seems a sensible idea. http://pqa.projects.postgresql.org/ -- Richard Huxton Archonet Ltd