Re: pg_stat_statements: can we extend the object names to the qualified names?

From: Sergei Agalakov <sergei(dot)agalakov(at)gmail(dot)com>
To: legrand legrand <legrand_legrand(at)hotmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_stat_statements: can we extend the object names to the qualified names?
Date: 2018-11-27 21:47:37
Message-ID: fc4b5c36-38c8-998e-5ff0-3cb6c9df64ce@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't agree.
If we already had a column with the execution plan in the
pg_stat_statements then
it would be a workaround for the problem with the ambiguous names in the
query text column.
But we don't have such column, and I don't want to create a dependency
on the unimplemented feature.
I rather fancy an extra column query_qn with the query text where all
the object names are substituted to the qualified names.
Remember that this problem isn't about only table names. The query may
have views, functions, operands etc. from the 'wrong' schema.

Sergei Agalakov

On 11/27/2018 2:10 PM, legrand legrand wrote:
> A part of the answer would be to store
> explain (verbose on) select count(*) from t1;
> result in pg_stat_statements for the corresponding query...
>
> (Verbose On) gives the "qualified names":
>
> QUERY PLAN
> ---------------------------------------
> Aggregate (cost=19.38..19.39 rows=1 width=8)
> Output: count(*)
> -> Seq Scan on s1.t1 (cost=0.00..17.50 rows=750 width=0)
> Output: a1, a2, a3, a4, a5, a6
>
>
> Extension pg_store_plans
> https://github.com/ossc-db/pg_store_plans
> can do it.
>
> Extesion auto_explain can help also.
>
> There are also some tryies to extend pg_stat_statements
> with plans see
> https://www.postgresql-archive.org/FEATURE-PATCH-pg-stat-statements-with-plans-td5940964.html
>
> Regards
> PAscal
>
>
>
>
>
>
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glenn Schultz 2018-11-28 09:35:09 Creating a function
Previous Message Sergei Agalakov 2018-11-27 21:30:20 Re: pg_stat_statements: can we extend the object names to the qualified names?