Re: New SQL counter statistics view (pg_stat_sql) - Mailing list pgsql-hackers

From Haribabu Kommi
Subject Re: New SQL counter statistics view (pg_stat_sql)
Date
Msg-id CAJrrPGeZALSp+p4C-kDoiQOTgS=hUstqO_PtiX9VbEJ=9Y_kCg@mail.gmail.com
Whole thread Raw
In response to Re: New SQL counter statistics view (pg_stat_sql)  (vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp>)
List pgsql-hackers


On Wed, Oct 12, 2016 at 4:06 PM, vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp> wrote:

Thank you for the patch.

Test: Commands with uppercase and lowercase
====
If the tag='select' then it returns the 0 rows but count is actually increment by 1.

tag='select' vs tag='SELECT'

postgres=# SET track_sql TO ON;
SET
postgres=# SELECT * FROM pg_stat_sql where tag='SELECT';
  tag   | count
--------+-------
 SELECT |    12
(1 row)

postgres=# SELECT * FROM pg_stat_sql where tag='SELECT';
  tag   | count
--------+-------
 SELECT |    13
(1 row)

postgres=# SELECT * FROM pg_stat_sql where tag='select';
 tag | count
-----+-------
(0 rows)

postgres=# SELECT * FROM pg_stat_sql where tag='SELECT';
  tag   | count
--------+-------
 SELECT |    15
(1 row)

I think all command works same as above.

Thanks for checking the patch.

Yes, that's correct. Currently the CAPS letters are used as tag names
that are getting displayed whenever any SQL command is executed.
So I used the same names as entries to store the details of stats of
SQL statements.

If anyone feels the other way is better, I am fine for it.


Regards,
Hari Babu
Fujitsu Australia

pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Steps inside ExecEndGather
Next
From: Haribabu Kommi
Date:
Subject: Re: New SQL counter statistics view (pg_stat_sql)