pg_stat_statements IN problem

Поиск
Список
Период
Сортировка
От byme@byme.email
Тема pg_stat_statements IN problem
Дата
Msg-id Z6FGe-JBOEhPm3AUulSOJc7z5UiSbr3U_N88tmBbXyNbwZLolx8kV7i8qBuJHYxI64cYcsXnV-2ynh1VBr3uK6doMBtuUkYXtpH70keFNYQ=@byme.email
обсуждение исходный текст
Ответы Re: pg_stat_statements IN problem
Список pgsql-general
Hello,

I would like to ask about a problem that is bothering me for a while now. We have implemented monitoring of our queries using pg_stat_statements. The only problem we have with it is that expressions with
IN ('first', 'second', 'third')
get translated into a query as
IN ($1, $2, $3)
and not as 
IN $1

This obfuscates our monitoring because the same query with different amount of arguments get translated into this:
IN ('first', 'second')
and so on.

I was trying to find some discussions about it, but could not find much. One suggestion was to use
= ANY
but that is a problem when using some third party framework for db operations, in our case for python, for example web2py's DAL or sqlalchemy. 

Is there a possibility the pg_stat_statements will be improved with handling IN? This problem makes it so much less useful right now.

Or is there something I could do to have the statistics for such queries aggreageted? Or is there something else I am missing?

Best regards

Lukas Jerabek

Sent with Proton Mail secure email.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_agent jobs
Следующее
От: "Karl O. Pinc"
Дата:
Сообщение: Trigger functions and parallelism