Re: [PROPOSAL] extend the object names to the qualified names in pg_stat_statements

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Sergei Agalakov <sergei(dot)agalakov(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PROPOSAL] extend the object names to the qualified names in pg_stat_statements
Date: 2018-11-28 21:46:49
Message-ID: 20181128214649.gnwd2qbo2hzlsv3e@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Nov-28, Tom Lane wrote:

> Sergei Agalakov <sergei(dot)agalakov(at)gmail(dot)com> writes:
> > It would help to analyze performance issues if pg_stat_statements would
> > extend the object names to the qualified names.
>
> What pg_stat_statements puts out is the original query text. As was
> already pointed out to you, changing that text is likely to break
> use-cases in which people are trying to match entries to actual
> queries or log entries.

It's not immediately obvious, but he is proposing a _new_ column
query_qn that has qualified names, leaving the current query column
unchanged.

> This would also entail rather significant overhead to find out schema
> names and interpolate them into the text.

True. I was thinking that the qualified-names version of the query
would be obtained via ruleutils or some similar mechanism to deparse
from the parsed query tree (not from the original query text), where
only pg_catalog is considered visible. This would be enabled using a
GUC that defaults to off.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2018-11-28 21:47:54 Re: Markdown format output for psql, design notes
Previous Message Tom Lane 2018-11-28 21:41:36 Re: Python versions (was Re: RHEL 8.0 build)