Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C73E14ADAAC for ; Sat, 10 Dec 2011 13:26:07 -0400 (AST) Received: from [2001:1528:137::f1] (helo=mail.gransy.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RZQgX-0005ky-UY for pgsql-performance@postgresql.org; Sat, 10 Dec 2011 17:26:06 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id 51A394A20A0 for ; Sat, 10 Dec 2011 18:25:51 +0100 (CET) Received: from mail.gransy.com ([82.208.29.194]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id giiHszm3WwrJ for ; Sat, 10 Dec 2011 18:25:51 +0100 (CET) Received: from [192.168.1.237] (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 29B354A2007 for ; Sat, 10 Dec 2011 18:25:51 +0100 (CET) Message-ID: <4EE39620.5020703@fuzzy.cz> Date: Sat, 10 Dec 2011 18:25:52 +0100 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Common slow query reasons - help with a special log References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:1528:137::f1 (failed) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201112/82 X-Sequence-Number: 45881 There's auto_explain contrib module that does exactly what you're asking for. Anyway, explain analyze is quite expensive - think twice before enabling that on production server where you already have performance issues. Tomas On 10.12.2011 17:52, Daniel Cristian Cruz wrote: > Hi all, >=20 > I'm trying to figure out some common slow queries running on the server= , > by analyzing the slow queries log. >=20 > I found debug_print_parse, debug_print_rewritten, debug_print_plan, > which are too much verbose and logs all queries. >=20 > I was thinking in something like a simple explain analyze just for > queries logged with log_min_duration_statement with the query too. >=20 > 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. >=20 > I'm thinking to write a paper that needs this information for my > postgraduate course. The focus of my work will be the log data, not > PostgreSQL itself. If I succeed, maybe it can be a tool to help all of = us. >=20 > Thank you, > --=20 > Daniel Cristian Cruz > =E3=82=AF=E3=83=AB=E3=82=BA =E3=82=AF=E3=83=AA=E3=82=B9=E3=83=81=E3=82=A2= =E3=83=B3 =E3=83=80=E3=83=8B=E3=82=A8=E3=83=AB