On Wed, Mar 20, 2019 at 11:10 PM legrand legrand <legrand_legr...@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.