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 1gXpHk-00023T-Oa for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Dec 2018 15:21:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gXpHj-0000QL-Cd for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Dec 2018 15:21:51 +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 1gXpHj-0000QE-5q for pgsql-hackers@lists.postgresql.org; Fri, 14 Dec 2018 15:21:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXpHh-000505-4L for pgsql-hackers@lists.postgresql.org; Fri, 14 Dec 2018 15:21:50 +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 wBEFLinq010562; Fri, 14 Dec 2018 10:21:44 -0500 From: Tom Lane To: Tomas Vondra cc: PostgreSQL Hackers Subject: Re: explain plans with information about (modified) gucs In-reply-to: References: Comments: In-reply-to Tomas Vondra message dated "Fri, 14 Dec 2018 12:41:36 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10560.1544800904.1@sss.pgh.pa.us> Date: Fri, 14 Dec 2018 10:21:44 -0500 Message-ID: <10561.1544800904@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > ... I propose to extend EXPLAIN output with an additional option, which > would include information about modified GUCs in the execution plan > (disabled by default, of course): I'm a bit suspicious about whether this'll have any actual value, if it's disabled by default (which I agree it needs to be, if only for compatibility reasons). The problem you're trying to solve is basically "I forgot that this might have an effect", but stuff that isn't shown by default will not help you un-forget. It certainly won't fix the form of the problem that I run into, which is people sending in EXPLAIN plans and not mentioning their weird local settings. > We certainly don't want to include all GUCs, so the question is how to > decide which GUCs are interesting. The simplest approach would be to > look for GUCs that changed in the session (source == PGC_S_SESSION), but > that does not help with SET SESSION AUTHORIZATION / ROLE cases. So we > probably want (source > PGC_S_ARGV), but probably not PGC_S_OVERRIDE > because that includes irrelevant options like wal_buffers etc. Don't you want to show anything that's not the built-in default? (I agree OVERRIDE could be excluded, but that's irrelevant for query tuning parameters.) Just because somebody injected a damfool setting of, say, random_page_cost via the postmaster command line or environment settings doesn't make it not damfool :-( regards, tom lane