Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D378C4ADAAC for ; Sat, 10 Dec 2011 13:25:59 -0400 (AST) Received: from mailout01.ims-firmen.de ([213.174.32.96]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RZQgQ-0004sI-Jx for pgsql-performance@postgresql.org; Sat, 10 Dec 2011 17:25:59 +0000 Received: from mailin02.ims-firmen.de ([192.168.1.111]) by mailout01.ims-firmen.de with esmtp (envelope-from ) id 1RZQgC-0006rw-Eq for pgsql-performance@postgresql.org; Sat, 10 Dec 2011 18:25:44 +0100 Received: from [87.170.172.251] (helo=a-kretschmer.de) by mailin02.ims-firmen.de with esmtpsa (TLSv1:AES256-SHA:256) (envelope-from ) id 1RZQgC-000867-92 for pgsql-performance@postgresql.org; Sat, 10 Dec 2011 18:25:44 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.69) (envelope-from ) id 1RZQgB-0005Ye-9l for pgsql-performance@postgresql.org; Sat, 10 Dec 2011 18:25:43 +0100 Date: Sat, 10 Dec 2011 18:25:43 +0100 From: Andreas Kretschmer To: pgsql-performance@postgresql.org Subject: Re: Common slow query reasons - help with a special log Message-ID: <20111210172543.GA21157@tux> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: Mutt/1.5.18 (2008-05-17) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/81 X-Sequence-Number: 45880 Daniel Cristian Cruz wrote: > Hi all, > > I'm trying to figure out some common slow queries running on the server, by > analyzing the slow queries log. > > I found debug_print_parse, debug_print_rewritten, debug_print_plan, which are > too much verbose and logs all queries. > > I was thinking in something like a simple explain analyze just for queries > logged with log_min_duration_statement with the query too. > > Is there a way to configure PostgreSQL to get this kind of information, maybe > I'm missing something? Is it too hard to hack into sources and do it by hand? I > never touched PostgreSQL sources. Consider auto_explain, it's a contrib-modul, see http://www.postgresql.org/docs/9.1/interactive/auto-explain.html Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknown) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°