Re: New SQL counter statistics view (pg_stat_sql)

Поиск
Список
Период
Сортировка
Искать
От
vinayak
Тема
Re: New SQL counter statistics view (pg_stat_sql)
Дата
Msg-id
4f6ce333-4ba3-c1d7-7276-4507b23dd4c1@lab.ntt.co.jp
Ответ на
Список
Дерево обсуждения
New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Tom Lane <tgl@sss.pgh.pa.us>
Re: New SQL counter statistics view (pg_stat_sql) Robert Haas <robertmhaas@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Andres Freund <andres@anarazel.de>
Re: New SQL counter statistics view (pg_stat_sql) Tom Lane <tgl@sss.pgh.pa.us>
Re: New SQL counter statistics view (pg_stat_sql) Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: New SQL counter statistics view (pg_stat_sql) neha khatri <nehakhatri5@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: New SQL counter statistics view (pg_stat_sql) neha khatri <nehakhatri5@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Robert Haas <robertmhaas@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: New SQL counter statistics view (pg_stat_sql) David Fetter <david@fetter.org>
Re: New SQL counter statistics view (pg_stat_sql) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: New SQL counter statistics view (pg_stat_sql) David Fetter <david@fetter.org>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Robert Haas <robertmhaas@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Dilip Kumar <dilipbalaut@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Dilip Kumar <dilipbalaut@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Dilip Kumar <dilipbalaut@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Andres Freund <andres@anarazel.de>
RE: New SQL counter statistics view (pg_stat_sql) "Smith, Peter" <peters@fast.au.fujitsu.com>
Re: New SQL counter statistics view (pg_stat_sql) Thomas Munro <thomas.munro@gmail.com>
RE: New SQL counter statistics view (pg_stat_sql) "Smith, Peter" <peters@fast.au.fujitsu.com>
Re: New SQL counter statistics view (pg_stat_sql) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: New SQL counter statistics view (pg_stat_sql) Michael Paquier <michael@paquier.xyz>
Re: New SQL counter statistics view (pg_stat_sql) Mark Dilger <mark.dilger@enterprisedb.com>
Command statistics system (cmdstats) Mark Dilger <mark.dilger@enterprisedb.com>
Re: Command statistics system (cmdstats) Mark Dilger <mark.dilger@enterprisedb.com>
Re: Command statistics system (cmdstats) Mark Dilger <mark.dilger@enterprisedb.com>
Re: Command statistics system (cmdstats) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Command statistics system (cmdstats) Mark Dilger <mark.dilger@enterprisedb.com>
Re: Command statistics system (cmdstats) Robert Haas <robertmhaas@gmail.com>
Re: Command statistics system (cmdstats) Michael Paquier <michael@paquier.xyz>
Re: Command statistics system (cmdstats) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Command statistics system (cmdstats) Mark Dilger <mark.dilger@enterprisedb.com>
Re: Command statistics system (cmdstats) Michael Paquier <michael@paquier.xyz>
Re: Command statistics system (cmdstats) Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Command statistics system (cmdstats) Michael Paquier <michael@paquier.xyz>
Re: Command statistics system (cmdstats) Michael Paquier <michael@paquier.xyz>
Re: Command statistics system (cmdstats) Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: [HACKERS] New SQL counter statistics view (pg_stat_sql) vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp>
Re: New SQL counter statistics view (pg_stat_sql) vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>
Re: New SQL counter statistics view (pg_stat_sql) Haribabu Kommi <kommi.haribabu@gmail.com>

On 2016/10/17 10:22, Haribabu Kommi wrote:


On Fri, Oct 14, 2016 at 7:48 PM, vinayak <Pokale_Vinayak_q3@lab.ntt.co.jp> wrote:

On 2016/10/12 12:21, Haribabu Kommi wrote:
I tried changing the pg_stat_sql into row mode and ran the regress suite to 
add different type of SQL commands to the view and ran the pgbench test
on my laptop to find out any performance impact with this patch.

                                HEAD      PATCH
pgbench - select      828          816

Here I attached the pg_stat_sql patch to keep track of all SQL commands
based on the commandTag and their counts. I attached the result of this
view that is run on the database after "make installcheck" just for reference.
Some comments:
I think we can use pgstat_* instead of pgstat* for code consistency.
 
+static HTAB *pgStatBackendSql = NULL;
How about *pgstat_backend_sql

+HTAB       *pgStatSql = NULL;
How about *pgstat_sql

Changed. 
 
+static void pgstat_recv_sqlstmt(PgStat_MsgSqlstmt * msg, int len);
How about PgStat_MsgSqlstmt *msg instead of PgStat_MsgSqlstmt * msg

Added the typdef into typdef.list file so this problem never occurs.
 
+typedef struct PgStatSqlstmtEntry
How about PgStat_SqlstmtEntry

+typedef struct PgStatMsgSqlstmt
How about PgStat_MsgSqlstmt


 changed.

Updated patch is attached.
The updated patch gives following error.
Error:
../../../../src/include/pgstat.h:557: error: ‘PgStatSqlstmtEntry’ undeclared here (not in a function)

-    ((PGSTAT_MSG_PAYLOAD - sizeof(int)) / sizeof(PgStatSqlstmtEntry))
+    ((PGSTAT_MSG_PAYLOAD - sizeof(int)) / sizeof(PgStat_SqlstmtEntry))
The attached patch fixed the error.

Regards,
Vinayak Pokale
В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: Michael Paquier
Дата:
FAQ