X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E80CD11F68D4 for ; Sun, 2 Apr 2006 11:45:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82526-05 for ; Sun, 2 Apr 2006 11:45:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id CF53811F6710 for ; Sun, 2 Apr 2006 11:45:42 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 3CD8E30D0A; Sun, 2 Apr 2006 16:45:43 +0200 (MET DST) From: "Qingqing Zhou" X-Newsgroups: pgsql.performance Subject: Re: Logging SQL queries to optimize them ? Date: Sun, 2 Apr 2006 22:45:34 +0800 Organization: Hub.Org Networking Services Lines: 16 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.171 required=5 tests=[AWL=0.171] X-Spam-Score: 0.171 X-Spam-Level: X-Archive-Number: 200604/13 X-Sequence-Number: 18097 "Bruno Baguette" wrote > > > Is there a way to log all SQL queries, with the date/time when they were > launched, and the cost of that query (if this is possible) in order to see > which queries need to be optimized ? > See if log_statement, log_statement_stats parameters can help you. Also, EXPLAIN ANALYZE can help you more on the target query. Regards, Qingqing