Re: query_id: jumble names of temp tables for better pg_stat_statement UX
От | Sami Imseih |
---|---|
Тема | Re: query_id: jumble names of temp tables for better pg_stat_statement UX |
Дата | |
Msg-id | CAA5RZ0t4XQ_SANiJ5VfuoKnAuxMaY2ggQWoGKkHo+U2H+Sh-Sw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: query_id: jumble names of temp tables for better pg_stat_statement UX (Michael Paquier <michael@paquier.xyz>) |
Ответы |
Re: query_id: jumble names of temp tables for better pg_stat_statement UX
|
Список | pgsql-hackers |
> So your idea to use the relation name in eref while skipping the > column list looks kind of promising. Per se the attached. Thoughts? I feel really uneasy about this behavior becoming the default. I can bet there are some users which run common queries across different schemas ( e.g. multi-tenancy ) will consider this behavior a regression in pg_stat_statements as now all their common queries have been merged into a single entry. For example, I have seen users add comments to SQLs to differentiate similar SQLs coming from different tenants. This patch makes this no longer a somewhat decent workaround to overcome the fact that pg_stat_statements does not track schemas or search path. ``` select pg_stat_statements_reset(); set search_path = s1; select /*+ user s1 */ * from foo; set search_path = s2; select /*+ user s2 */ * from foo; reset search_path; select userid, queryid, query, calls from public.pg_stat_statements; test=# select userid, queryid, query, calls from public.pg_stat_statements; userid | queryid | query | calls --------+----------------------+-----------------------------------+------- 10 | 1788423388555345932 | select /*+ user s1 */ * from foo | 2 10 | -8935568138104064674 | select pg_stat_statements_reset() | 1 10 | -8663970364987885379 | set search_path = $1 | 2 10 | -6563543739552933350 | reset search_path | 1 (4 rows) ``` -- Sami Imseih Amazon Web Services (AWS)
В списке pgsql-hackers по дате отправления: