Re: Get the statistics based on the application name and IP address

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Ibrar Ahmed <ibrar(dot)ahmed(at)percona(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Get the statistics based on the application name and IP address
Date: 2022-08-08 17:11:40
Message-ID: 20220808171140.jldgjnk26b4wsygu@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Aug 08, 2022 at 08:21:06PM +0500, Ibrar Ahmed wrote:
> While working on pg_stat_stements, I got some questions from customers to
> have statistics by application and IP address.
> [...]
> name. I did some POC and had a patch. But before sharing the patch.
>
> I need to know if there has been any previous discussion about this topic;
> by the way,

I don't think there was any discussion on this exactly, but there have been
some related discussions.

This would likely bring 2 problems. First, for now each entry contains its own
query text in the query file. There can already be some duplication, which
isn't great, but adding the application_name and/or IP address will make things
way worse, so you would probably need to fix that first. There has been some
discussion about it recently (1) but more work and benchmarking are needed.

The other problem is the multiplication of entries. It's a well known
limitation that pg_stat_statements eviction are so costly that it makes it
unusable. The last numbers I saw about it was ~55% overhead (2). Adding
application_name or ip address to the key would probably make
pg_stat_statements unusable for anyone who would actually need those metrics.

[1]: https://www.postgresql.org/message-id/flat/604E3199-2DD2-47DD-AC47-774A6F97DCA9%40amazon.com
[2]: https://twitter.com/AndresFreundTec/status/1105585237772263424

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-08-08 17:46:02 Re: make update-po@master stops at pg_upgrade
Previous Message Mark Wong 2022-08-08 17:06:14 Re: Asking for feedback on Pgperffarm