Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1epIz4-0004Bt-O3 for pgsql-bugs@arkaria.postgresql.org; Fri, 23 Feb 2018 19:26:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epIz3-0004zU-9u for pgsql-bugs@arkaria.postgresql.org; Fri, 23 Feb 2018 19:26:17 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1epIz3-0004zL-4D for pgsql-bugs@lists.postgresql.org; Fri, 23 Feb 2018 19:26:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1epIz0-0001NP-4S for pgsql-bugs@lists.postgresql.org; Fri, 23 Feb 2018 19:26:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1NJPxO6016576; Fri, 23 Feb 2018 14:25:59 -0500 From: Tom Lane To: "David G. Johnston" cc: Kevin Bloch , pgsql-bugs@lists.postgresql.org Subject: Re: maximum for auto_explain.log_min_duration doesn't seem to make sense In-reply-to: References: <8ea82d7e-cb78-8e05-0629-73aa14d2a0ca@codingthat.com> Comments: In-reply-to "David G. Johnston" message dated "Fri, 23 Feb 2018 12:02:58 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <16574.1519413959.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 23 Feb 2018 14:25:59 -0500 Message-ID: <16575.1519413959@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Fri, Feb 23, 2018 at 11:34 AM, Kevin Bloch wrote: >> According to https://dba.stackexchange.com/a/198429/28774 , this setting >> maxes out at INT_MAX / 1000, but since it's never multiplied by 1000 or any >> other number, it seems it should perhaps just be INT_MAX > ​I suspect that the counter to which that value is being compared also > wants to be an INT and if one checks for "val > INT_MAX" then val cannot be > restricted to an integer (and since we are capturing time we need some > unknown buffer). No, a look at the code shows that it's being compared to a double. So there's no practical problem with increasing that GUC's limit to INT_MAX. As to whether it's worth doing, the existing limit is equivalent to ~35 minutes if I did the math right. I can barely imagine that anyone would want to set auto_explain.log_min_duration higher than that, but maybe in some huge data warehouse environment it'd make sense. Anyway, I notice that the core backend's log_min_duration GUC, which is also measured in ms, is allowed to go up to INT_MAX; so it seems a bit inconsistent that this one isn't. In short, seems like a valid complaint to me. regards, tom lane