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 1gZ2Sx-0005fF-0l for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Dec 2018 23:38:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZ2Sv-00013G-P1 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Dec 2018 23:38:25 +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 1gZ2Sv-000139-Cx for pgsql-hackers@lists.postgresql.org; Mon, 17 Dec 2018 23:38:25 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ2Ss-0002vy-Em for pgsql-hackers@postgresql.org; Mon, 17 Dec 2018 23:38:24 +0000 Received: by mail-wr1-x432.google.com with SMTP id t6so13869709wrr.12 for ; Mon, 17 Dec 2018 15:38:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7+38TRJ8yud9pO+7clv/dVpLlU+dqChLt96K3pTMVsI=; b=EaZkd6SElN4ABSX6gtNQdRpFn2yzUxPted9FOAoL5ttxrCovKnH5Q3tQwOBS2/kUnn 3ahh+OpSpsX7FgVoBevdYQXJHNVdzTlPfOYKgwnZvl8YYXAWQAQ74SfrJwGWF+bFVvdG q2pV1M6PaZ+uMytQTOkX69O3S56DBBBICk9ICBayE6fKxr3OoXbBo8wkWnAZvH/4+v5r xnNGWv8V5OvTkLW9rLBmuzy/kiZ3/F0aC4X3bQjZUD9aiCzgx3KkosqZdw0OQ4domugx JFKlsbNVfmyf4eMtv7d5H4cO4PxVbwrTx24129Xd0k+f5Sg5lhFZWjrxv5LzeHVx8dyx AxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7+38TRJ8yud9pO+7clv/dVpLlU+dqChLt96K3pTMVsI=; b=lRWsjEZiuEK1XUQpkr8Qg1WoWxq2oyxWF740NYbxHj4IV92iVazgGndTVE9m/1Rp3A RrSfUlD5uLizjK8wXvvXi7dCNq3umm+EJCLHCf9jf6guTVSv90qGz8MS473u1GzoiauD S19jq+JOGYlrnOwuSUlNr671H/Zlt9lPr2kLkpPf5ZG5ky0zg8/6dwRNIHwbw1bpTbC1 41WjVjJ5xe6wHAYfjjqmRPwl4HWb4DaZFSTPPoCP4uJOIL4HeXL3Ljv5mK5kmDiwCQtN ogrQnXDp4smMjk+hz0qnFb5aRhXfwAYjyEjz+U6ePkTgY2Z12EfaO5nMnL3opOQ1/pdQ V5uw== X-Gm-Message-State: AA+aEWYqyLEBbepymnDny4ZNZnCvsoBcqqPZYX8mNvU4ETc1daHKyFXp YqdTS8tLWOghfvc3ji23yAvLSHiIOpHdm3yIMw2Ucdx3dNMfiVrsqyAFjhEXZmnTc90Zzl8apRs lqj4iiRjwU+NvBhoWnhfktU91koCGHUPpeMwRZKBxLiA4+kdlwLAx6HR7UTdVsVOO3tQxlUcwG+ oc7/EB+wQEpVAL1A== X-Google-Smtp-Source: AFSGD/VxjqTAsnjI2X3kD74OvcTtT4t1pmwOS/bBDgtikQAfK881vAwyT7xTWkCeh/hZowrvysCs/g== X-Received: by 2002:a5d:67cf:: with SMTP id n15mr11944350wrw.211.1545089900495; Mon, 17 Dec 2018 15:38:20 -0800 (PST) Received: from [10.137.2.19] (ip-86-49-251-50.net.upcbroadband.cz. [86.49.251.50]) by smtp.gmail.com with ESMTPSA id e16sm1757668wrn.72.2018.12.17.15.38.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 15:38:19 -0800 (PST) Subject: Re: explain plans with information about (modified) gucs To: Tom Lane Cc: legrand legrand , pgsql-hackers@postgresql.org References: <10561.1544800904@sss.pgh.pa.us> <631ae5c8-5581-6c5e-382c-2dcdb2e5c956@2ndquadrant.com> <1545083780942-0.post@n3.nabble.com> <1edcee55-ea96-d123-199d-4c5f1fc5003b@2ndquadrant.com> <24065.1545085015@sss.pgh.pa.us> From: Tomas Vondra Message-ID: <2c09fe19-e4a0-ea66-5a7f-e69d46420e28@2ndquadrant.com> Date: Tue, 18 Dec 2018 00:38:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <24065.1545085015@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/17/18 11:16 PM, Tom Lane wrote: > Tomas Vondra writes: >> On 12/17/18 10:56 PM, legrand legrand wrote: >>> what would you think about adding >>> search_path >>> to that list ? > >> Yeah, I've been thinking about that too. Currently it gets filtered out >> because it's in the CLIENT_CONN_STATEMENT group, but the code only >> includes QUERY_TUNING_*. >> But we don't want to include everything from CLIENT_CONN_STATEMENT, >> because that would include various kinds of timeouts, vacuuming >> parameters, etc. >> And the same issue applies to work_mem, which is in RESOURCES_MEM. And >> of course, there's a lot of unrelated stuff in RESOURCES_MEM. >> So I guess we'll need to enable QUERY_TUNING_* and then selectively a >> couple of individual options from other groups. > > This is putting way too much policy into the mechanism, if you ask me. > Doesn't that depend on how it'd be implemented? I have not envisioned to make these decisions in explain.c, but rather to keep them in guc.c somehow. Say in a function like this: bool guc_affects_query_planning(config_generic *conf); which would be a fairly simple check outlined before (QUERY_TUNING_* plus a couple of individual GUCs). Other use cases might provide similar filters. An alternative would be to somehow track this in the GUC definitions directly (similarly to how we track the group), but that seems rather inflexible and I'm not sure how would that handle ad-hoc use cases. > At least for the auto_explain use case, it'd make far more sense for > the user to be able to specify which GUCs he wants the query space > to be divided according to. While it's possible to imagine giving > auto_explain a control setting that's a list of GUC names, I'm not > sure how we adapt the idea for other use-cases. But the direction > you're headed here will mostly ensure that nobody is happy. > I certainly don't want to base this on explicitly listing "interesting" GUCs anywhere. That would make it pretty useless for the use case I care about, i.e. using auto_explain to investigate slow plans, when I don't really know what GUC the application might have changed (certainly not in advance). I can't really say how to adopt this to other use cases, considering there are none proposed (and I can't think of any either). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services