X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 07F78D1B34A for ; Wed, 4 Aug 2004 09:00:51 -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 12765-06 for ; Wed, 4 Aug 2004 12:00:52 +0000 (GMT) Received: from thor.netera.se (thor.netera.se [62.13.47.20]) by svr1.postgresql.org (Postfix) with ESMTP id 0BC2CD1B257 for ; Wed, 4 Aug 2004 09:00:42 -0300 (ADT) Received: from [127.0.0.1] (unknown [213.212.22.34]) by thor.netera.se (Postfix) with ESMTP id 6895E13AC050 for ; Wed, 4 Aug 2004 14:00:49 +0200 (CEST) Message-ID: <4110CFE7.9000202@relevanttraffic.se> Date: Wed, 04 Aug 2004 14:00:39 +0200 From: Ulrich Wisser Organization: Relevant Traffic AB User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: How to know which queries are to be optimised? 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/77 X-Sequence-Number: 63632 Hello, my web application grows slower and slower over time. After some profiling I came to the conclusion that my SQL queries are the biggest time spenders (25 seconds). Obviously I need to optimise my queries and maybe introduce some new indexes. The problem is, that my application uses dynamic queries. I therefor can not determine what are the most common queries. I have used the postgresql logging ption before. Is there a tool to analyze the logfile for the most common and/or most time consuming queries? TIA Ulrich