Обсуждение: Regarding pg_stat_statements

Поиск
Список
Период
Сортировка

Regarding pg_stat_statements

От
Sreerama Manoj
Дата:
Hi,
      As we know that "pg_stat_statements" will monitor the queries after normalizing the queries(Removes the values present in query). I want to know is there a way to store those normalized values because I want to check the type of data(values) ,range of data that is being hit to the database. I am using Postgres 9.4

Re: Regarding pg_stat_statements

От
Ronan Dunklau
Дата:
Le vendredi 13 mars 2015 14:59:28 Sreerama Manoj a écrit :
> Hi,
>       As we know that "pg_stat_statements" will monitor the queries after
> normalizing the queries(Removes the values present in query). I want to
> know is there a way to store those normalized values because I want to
> check the type of data(values) ,range of data that is being hit to the
> database. I am using Postgres 9.4

Hello.

You may be interested in the pg_qualstats extension:
https://github.com/dalibo/pg_qualstats

The purpose of the extension is to track values like pg_stat_statements, but
at the predicate level rather than statement level. It stores normalized
predicates as well as constants.

The documentation is here:

http://powa.readthedocs.org/en/latest/stats_extensions/pg_qualstats.html#pg-qualstats

It won't give you all normalized values though, only those present in
predicates.

--
Ronan Dunklau
http://dalibo.com - http://dalibo.org

Re: Regarding pg_stat_statements

От
Josh Berkus
Дата:
On 03/13/2015 02:29 AM, Sreerama Manoj wrote:
>       As we know that "pg_stat_statements" will monitor the queries
> after normalizing the queries(Removes the values present in query). I
> want to know is there a way to store those normalized values because I
> want to check the type of data(values) ,range of data that is being hit
> to the database. I am using Postgres 9.4

BTW, this really isn't appropriate for the pgsql-hackers list; please
ask your next question like this on pgsql-general or pgsql-performance.

However, pg_qualstats is what you want:
http://powa.readthedocs.org/en/latest/stats_extensions/pg_qualstats.html

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com