# Measuring sql queries executed remotely

**URL:** <https://forums.percona.com/t/measuring-sql-queries-executed-remotely/10546>\
**Category:** PostgreSQL\
**Created:** [May 21, 2021, 8:41am UTC](https://forums.percona.com/t/measuring-sql-queries-executed-remotely/10546 "2021-05-21T08:41:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![txapeldot](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@txapeldot](https://forums.percona.com/u/txapeldot)\
**Post date:** [May 21, 2021, 8:41am UTC](https://forums.percona.com/t/measuring-sql-queries-executed-remotely/10546/1 "2021-05-21T08:41:22Z")

</div>

Hi there:

I’d like to know if any of the Percona’s products could be useful to tackle the problem I’m facing to with my PostgreSQL database.

My necessity is about measuring the time some custom sql queries take to be executed on a remote-server-hosted PostgreSQL database. I could launch these sql queries from an ad-hoc Java program running on my PC and then measure the time invested to be done, but I think these measured times could be biased due to the network traffic. This’s why I’d be interested in measuring these times on the server side directly.

It’s in that scenario where I wonder if some of the Percona’s products could be useful to carry on the test I want to do.

Any help or clarification will be really appreciate. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![HamidAkhtar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hamidakhtar/32/3688_2.png) [@HamidAkhtar](https://forums.percona.com/u/HamidAkhtar)\
**Post date:** [May 21, 2021, 11:07am UTC](https://forums.percona.com/t/measuring-sql-queries-executed-remotely/10546/2 "2021-05-21T11:07:32Z")

</div>

Are you using vanilla PostgreSQL or Percona PostgreSQL Distribution (PPD)?

If you are using PPD, you might want to explore pg\_stat\_monitor extension that’s contained in the package. That is if you have the requisite permissions to create an extension.

You see pg\_stat\_monitor in more detail on our github.

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [May 24, 2021, 10:18pm UTC](https://forums.percona.com/t/measuring-sql-queries-executed-remotely/10546/3 "2021-05-24T22:18:15Z")

</div>

Hi @txapeldot  
Percona has written software to address this very need you have - it is called Percona Monitoring and Management, and fully supports PostgreSQL and in fact leverages `pg_stat_monitor` .

> **[PostgreSQL - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/postgresql.html)**
>
> Documentation

In particular look at the Query Analytics component for query performance metrics. Let us know if this meets your needs!
