Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hD9lH-00085D-2v for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Apr 2019 15:31:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hD9lE-00037z-3N for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Apr 2019 15:31:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hD9lD-00037F-Qi for pgsql-hackers@lists.postgresql.org; Sun, 07 Apr 2019 15:31:07 +0000 Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hD9lA-0003yh-MX for pgsql-hackers@postgresql.org; Sun, 07 Apr 2019 15:31:07 +0000 Received: by mail-io1-xd44.google.com with SMTP id p23so8284303iol.13 for ; Sun, 07 Apr 2019 08:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3q1/oXWWJDjXOEwINrf3Ei9uwdKVk0VBNg7ON8FyRKs=; b=hvd9tfQck0FXdpm48sFefIgHCALnNVaKOUxCTIsMOyfdc3Txe6xhC/z3YCOMd3CMov BezdJGWWZmw859dkXP6VG5/2P4ZNwvXZtEqXkLHfoHXCk/f+MVaCq0k7z4RWDnoIVqZH Ffhp4arZMlZhd3mwcFiyclYhN/VC80ZSzV7KQ6LWfL0ZcEZdQKoOIwKDW1KHmgwGpgv3 jefLgCMFYYP+n5Ejsfw2pEj7pwURi96N/6POyKuRiGDNDXYwFjYMMbjMwqZgLFbq/goC 2YuowzRQPxIGSI1KZ2lQMtoV0KZwfjVRvLR+KA8nCtnmm1vRugs1bL8Bq8z9MMPQyTKn Zhjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3q1/oXWWJDjXOEwINrf3Ei9uwdKVk0VBNg7ON8FyRKs=; b=PrSg55Q05ATwrFOYekS1HEt5WvqhevbL34LtZjRClMbX1KLr2tvBx7D03Hv6bqs0jD WkaaB5kpu58UDBbLqNz/SK1rbOdck4Qzwfr+bULVrW31bGOjg5c2vRIcr7+NZd5+nNt9 M8uZG2mdFZmLlWwykgxm8/vxZsYOCsqgRMhpS1t0TLrOum3CegTCQDOQmAIDnKlm8Q/K uvWqyMJHxFv/pWEuU6lN93B593y6GDnYnfCNYL2vBvZF3xEmR3fKlUsAd+4h8GZ2yxUI n7jNJTfvVwngwaCHQgTGNjSYs4v5DyfbjGI4IimEdvuaZcinULf3ILR98Fkcs1rzBAVE UQMQ== X-Gm-Message-State: APjAAAXPXEMLiR38e+1EA/V3945vLpopg/fwgGo5Rc8sl70+KU/18tMN uvNSri1l2Y2VcLTCYqBqn5fcfA== X-Google-Smtp-Source: APXvYqzjqNO963pnDFSMBQypeQkKLMVJoeZuwUc2r6tIoLs3XKbV+g1WoS+twBbZj8kSru4oq7EFWw== X-Received: by 2002:a6b:6f09:: with SMTP id k9mr7753249ioc.163.1554651062915; Sun, 07 Apr 2019 08:31:02 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id w6sm10369498iom.22.2019.04.07.08.31.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Apr 2019 08:31:02 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 3404D801065; Sun, 7 Apr 2019 10:31:01 -0500 (CDT) Date: Sun, 7 Apr 2019 10:31:01 -0500 From: Justin Pryzby To: Andres Freund Cc: Alvaro Herrera , Arthur Zakirov , pgsql-hackers@postgresql.org Subject: Re: query logging of prepared statements Message-ID: <20190407153101.GA10080@telsasoft.com> References: <20190404182630.GA4305@alvherre.pgsql> <20190404190126.GA6155@alvherre.pgsql> <20190406011638.pgb7uxjz2hnhavsu@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190406011638.pgb7uxjz2hnhavsu@alap3.anarazel.de> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Thanks both for thinking about this. On Fri, Apr 05, 2019 at 06:16:38PM -0700, Andres Freund wrote: > On 2019-04-04 16:01:26 -0300, Alvaro Herrera wrote: > > Also, if you parse once and bind/execute many times, IMO the statement > > should be logged exactly once. I think you could that with the flag I > > propose. > I think deduplicating the logging between bind and execute has less of > that hazard. Do you mean the bind parameters, which are only duplicated in the case of log_min_duration_statement ? I actually implemented that, using Alvaro's suggestion of a flag in the Portal, and decided that if duration is exceeded, for bind or execute, then it's likely desirable to log the params, even if it's duplicitive. Since I've been using log_statement=all, and not log_min_duration_statement, I don't have a strong opinion about it. Perhaps you're right (and perhaps I should switch to log_min_duration_statement). I'll tentately plan to withdraw the patch. Thanks, Justin