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 1gjDi2-0007zY-RE for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jan 2019 01:40:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjDi0-0002kt-4T for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Jan 2019 01:40:04 +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 1gjDhz-0002kV-Pp for pgsql-hackers@lists.postgresql.org; Tue, 15 Jan 2019 01:40:03 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjDhs-0006iG-EH for pgsql-hackers@postgresql.org; Tue, 15 Jan 2019 01:40:03 +0000 Received: by mail-wr1-x444.google.com with SMTP id l9so1084613wrt.13 for ; Mon, 14 Jan 2019 17:39:56 -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=9DdORVDBy4KR+60mYsinjPy13CcYcuuOg9cFjglEz9Y=; b=fh8riinRJFuelHRlZm+BSx444i2z9v4mC/4o8Y3zmXGBYCK2F4R/pc1v7ijGdmA9kv YLCWF4cEPWT/kPap0ZOpkHQeG8/fV3xI7OgQ/vftmsG6rcMgBd/5WbM9GEb3lY/bRuRq T+5Irjv2AMfsAilJjDlLl3DnhjPauT29x8KzTRHPFpeXofwJEmdxPlN2uOPUkXyYihdJ ce8Nv4ou3TdchBz4lAngF5DKf8dfSO5z6b+ftx54yTbpFI6+goBKI9AzWaDb8Njvo26R +6MRrycTBLGz2T35iioNmEd8WkUIC6cQVruMsntMmSxKPebnPmP163Tzu2I+BCDYg7nG ZrQg== 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=9DdORVDBy4KR+60mYsinjPy13CcYcuuOg9cFjglEz9Y=; b=SV/8IGWD6UC1eMUxrj9PAf30CFC++pSZIuUiOzhFHg+YxU89xIhLCiMomH/c3EL6A0 MzkFW+hB3Vv/EijnDG+wi5HpWJ4JXQKyxr/5pWsrQbv7/gj6ryiBX74i7hXP8nfccII2 1n+yKGBiOG3eKgFg3AQSWq8Cdxzf4dIHKpDnoligjqkpJClBirSuV3GnZQhlwIZGEQBg VNLnq2EkDOoftldSOA86CWWDWwMe+B59XjXqZca0RpYWAAt+prE75aK7CaFva22Omus8 qEN6eWeMyNXNlq9wqQL300rmxx6BhtNtCkfwb5ua5Qe49tCYZE4y9PeGhY7Srt2D+VYy mqag== X-Gm-Message-State: AJcUukf0YWFq9Hv/auYQQw8srw/7ptSfLPRJy3kiyvkkVY592VyHHepG kbnWbwFWqOEFgDN0SBrf0Uh4R7r9ERNml6DXWv+lSfKFfwcVbFVJCSIVyK5NuYgmzVRw7+Ry3Ry YrFkviU9Qzdc2F959HwCilGKpokYmroxGXgn2C3HYD5jINkp/b67NkIwBPn6B4ojVZvaTypXwht D0Wn6NHpmf1Uw= X-Google-Smtp-Source: ALg8bN7gRADQvdgdOw6ZE6K8wN7BsCsMTfI/8xvLzxf0ig5dRcBb+HG3FDZMUp/nBtdiWwHtnRBxuA== X-Received: by 2002:a5d:43d0:: with SMTP id v16mr976541wrr.67.1547516393641; Mon, 14 Jan 2019 17:39:53 -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 60sm104027501wrb.81.2019.01.14.17.39.52 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 17:39:52 -0800 (PST) Subject: Re: explain plans with information about (modified) gucs To: Alvaro Herrera Cc: Sergei Agalakov , pgsql-hackers@postgresql.org References: <201901142213.gt7vdg65pp4d@alvherre.pgsql> From: Tomas Vondra Message-ID: Date: Tue, 15 Jan 2019 02:39:49 +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: <201901142213.gt7vdg65pp4d@alvherre.pgsql> 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 1/14/19 11:13 PM, Alvaro Herrera wrote: > On 2019-Jan-14, Tomas Vondra wrote: > >> The one slightly annoying issue is that currently all the options are >> formatted as text, including e.g. cpu_tuple_cost. That's because the GUC >> options may have show hook, so I can't access the value directly (not >> sure if there's an option around it). > > I think the problem is that you'd have to know how to print the value, > which can be in one of several different C types. You'd have to grow > some more infrastructure in the GUC tables, I think, and that doesn't > seem worth the trouble. Printing as text seems enough. > I don't think the number of formats is such a big issue - the range of formats is quite limited: PGC_BOOL, PGC_INT, PGC_REAL, PGC_STRING and PGC_ENUM. But the show hook simply returns string, and I'm not sure it's guaranteed it matches the raw value (afaik the assign/show hooks can do all kinds of funny stuff). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services