Re: [survey] New "Stable" QueryId based on normalized query text

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: [survey] New "Stable" QueryId based on normalized query text
Дата
Msg-id CAOBaU_Yypcom2VxW4mEizx+wAzRdgsn-1jGyZH8seKiLxQNyxQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [survey] New "Stable" QueryId based on normalized query text  (legrand legrand <legrand_legrand@hotmail.com>)
Список pgsql-hackers
On Wed, Mar 20, 2019 at 11:10 PM legrand legrand
<legrand_legrand@hotmail.com> wrote:
>
> Thank you Julien for the workaround,
> It is not easy to build "cross tables" in excel to join metrics per query
> text ...

then keep only one queryid over all environments, that's easy enough in SQL:

SELECT min(queryid) OVER (partition by query ORDER BY environment),
... FROM all_pg_stat_statements

if you have your environment named like 0_production,
1_preproduction... you'll get the queryid from production.  Once
again, that's not ideal but it's easy to deal with it when consuming
the data.

> and I'm not ready to build a MD5(query) as many query could lead to the same
> QueryId

I'd be really surprised if you see a single collision in your whole
life, whatever pg_stat_statements.max you're using.  I'm also pretty
sure that the collision risk is technically higher with an 8B queryId
field rather than a 16B md5, but maybe I'm wrong.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Removing unneeded self joins
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: PostgreSQL pollutes the file system