Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id EE96AB5DBDD for ; Mon, 20 Jun 2011 16:09:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 69848-02-3 for ; Mon, 20 Jun 2011 19:09:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gransy.com (mail.gransy.com [82.208.29.194]) by mail.postgresql.org (Postfix) with ESMTP id 8608AB5DBE1 for ; Mon, 20 Jun 2011 16:09:46 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.gransy.com (Postfix) with ESMTP id 5B5F54A221F for ; Mon, 20 Jun 2011 21:09:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at nathalia.gransy.com Received: from mail.gransy.com ([127.0.0.1]) by localhost (Nathalka.gransy.com.gransy.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fpa5iexrFdDM for ; Mon, 20 Jun 2011 21:09:34 +0200 (CEST) Received: from [192.168.1.221] (ip-78-45-133-255.net.upcbroadband.cz [78.45.133.255]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id B9E184A21F7 for ; Mon, 20 Jun 2011 21:09:34 +0200 (CEST) Message-ID: <4DFF9AEE.8080009@fuzzy.cz> Date: Mon, 20 Jun 2011 21:09:34 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110619 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: how to know slowly query in lock postgre References: <821517.42508.qm@web77309.mail.sg1.yahoo.com> In-Reply-To: <821517.42508.qm@web77309.mail.sg1.yahoo.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/186 X-Sequence-Number: 44119 Dne 20.6.2011 09:57, Didik Prasetyo napsal(a): > hai friend i have problem with performance database in postgre, how to > know slowly query in postgre, > i want kill or stop query to make postgre slowly, on the server status > on the admin pg, sometimes the query and how long the query runs do not > appear > > Thanks for solution Killing long running queries probably is not a good idea (at least the users usually think that). You should try to identify the slow queries and optimize them first. The "log_min_duration_statement" can do that - the queries that take longer will be written to the postgresql log. http://www.postgresql.org/docs/8.3/static/runtime-config-logging.html regards Tomas