Re: Expose options to explain? (track_io_timing)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Expose options to explain? (track_io_timing)
Date: 2014-10-14 17:01:24
Message-ID: CA+TgmoZcvz2msrpgJ+yqjCbf5R62bLJpWbfSkfKZjFq_gkRoGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 9, 2014 at 2:41 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> I think the theory for track_io_timing being PGC_SUSET is that if the
> superuser turned it on, no one should be able to turn it off.
>
> But I don't see an argument for the other way around, that no one should be
> able to turn it on locally of the superuser left it at the default of off.
>
> So I think the real behavior we would want is that anyone can turn it on in
> their session, and can also turn it off provided it was turned on by them in
> the first place. But there is no machinery in the GUC code to do that,
> which is probably why it wasn't done. I meant to work on that for this dev
> cycle, but I never dug into how to implement the "provided it was turned on
> by them in the first place" part of the requirement. And how would this be
> expressed generically? Some notion that the default value can be a floor or
> ceiling which the user can alter in one direction, and reverse that
> alteration. PGC_SUSET_FLOOR and PGC_SUSET_CEILING?

Hmm. IIRC, there are only two use cases for I/O timing at present:
pg_stat_statements (which really only makes sense if it's turned on or
off system-wide) and EXPLAIN. Rather than inventing more GUC
machinery, I think we could just add an explain flag called "IO". So
you could do:

EXPLAIN (ANALYZE, IO) SELECT ....

And that would gather I/O stats even if it's turned off system-wide.
Or you could do:

EXPLAIN (ANALYZE, IO false) SELECT ....

That can't really be allowed to suppress gathering the I/O stats for
this query if the sysadmin wants those stats for all queries. But it
could suppress the print-out.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-10-14 17:02:12 Re: Buffer Requests Trace
Previous Message Lucas Lersch 2014-10-14 16:59:39 Re: Buffer Requests Trace