Re: New SQL counter statistics view (pg_stat_sql)

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: vinayak <Pokale_Vinayak_q3(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New SQL counter statistics view (pg_stat_sql)
Date: 2016-10-17 01:22:20
Message-ID: CAJrrPGeZALSp+p4C-kDoiQOTgS=hUstqO_PtiX9VbEJ=9Y_kCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 12, 2016 at 4:06 PM, vinayak <Pokale_Vinayak_q3(at)lab(dot)ntt(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2016-10-17 01:22:51 Re: New SQL counter statistics view (pg_stat_sql)
Previous Message Kouhei Kaigai 2016-10-17 00:52:30 Steps inside ExecEndGather