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 обсуждение исходный текст |
Ответ на | Re: New SQL counter statistics view (pg_stat_sql) (Haribabu Kommi <kommi.haribabu@gmail.com>) |
Список | pgsql-hackers |
On 2016/10/17 10:22, Haribabu Kommi wrote:
The updated patch gives following error.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:Some comments:I tried changing the pg_stat_sql into row mode and ran the regress suite toadd different type of SQL commands to the view and ran the pgbench teston my laptop to find out any performance impact with this patch.HEAD PATCHpgbench - select 828 816Here I attached the pg_stat_sql patch to keep track of all SQL commandsbased on the commandTag and their counts. I attached the result of thisview that is run on the database after "make installcheck" just for reference.
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_sqlChanged.+static void pgstat_recv_sqlstmt(PgStat_MsgSqlstmt * msg, int len);
How about PgStat_MsgSqlstmt *msg instead of PgStat_MsgSqlstmt * msgAdded the typdef into typdef.list file so this problem never occurs.+typedef struct PgStatSqlstmtEntry
How about PgStat_SqlstmtEntry
+typedef struct PgStatMsgSqlstmt
How about PgStat_MsgSqlstmtchanged.Updated patch is attached.
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 по дате отправления: