Re: explain plans with information about (modified) gucs

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, legrand legrand <legrand_legrand(at)hotmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: explain plans with information about (modified) gucs
Date: 2019-01-01 17:39:17
Message-ID: d222191c-4b66-ba29-ca27-965741442888@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Attached is v4, changing how GUCs are picked for inclusion on the query
plans. Instead of picking the GUCs based on group and/or explicitly, a
new GUC_EXPLAIN flag is used for that.

I went through GUCs defined in guc.c and marked those in QUERY_TUNING*
groups accordingly, with the exception of default_statistics_target
because that seems somewhat useless without showing the value used to
actually analyze the table (and/or columns).

I've also included a couple of other GUCs, that I find to be relevant:

- parallel_leader_participation
- max_parallel_workers_per_gather
- max_parallel_workers
- search_path
- effective_io_concurrency
- work_mem
- temp_buffers
- plan_cache_mode

I think this covers the interesting GUCs pretty well, although perhaps I
missed something.

The one bit that needs fixing is escaping the GUC values when showing
them in the plan. Looking at the other places that currently escape
stuff, I see they only care about YAML/JSON/XML and leave the regular
output unescaped. I was wondering if it's OK with the current format
with all GUCs on a single line

QUERY PLAN
---------------------------------------------------
Seq Scan on t (cost=0.00..54.63 rows=13 width=4)
Filter: ('x''y'::text = (a)::text)
GUCs: enable_nestloop = 'off', work_mem = '32MB'
(3 rows)

but I suppose it is, because without the escaping a user can break
whatever format we use. So I'll do the same thing, escaping just the
structured formats (YAML et al).

The question however is whether someone has a better formatting idea?

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
explain-with-gucs-v4.patch text/x-patch 25.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2019-01-01 17:48:52 Re: explain plans with information about (modified) gucs
Previous Message Tomas Vondra 2019-01-01 17:39:12 Re: shared-memory based stats collector