Query plan is not displayed for postgres13 database

Hi Folks,

I have installed PMM2 recently and added a target ubuntu machine which runs postgreSQL13, Installation went fine, i can see other statistics but not the query plan. When clicking on the plan tab, i am getting the below message.

“No plan found”

Do anyone faced this issue before?

The below extensions are present in the database
pg_stat_statements & pg_stat_monitor

Kind Regards,
Raghu

1 Like

What command did you use to add the client? the Examples and Plan tabs will only work if pg_stat_monitor is enabled on the postgresql server but you also have to explicitly add the node to PMM setting pg_stat_mon as the query-source with the --query-source=pgstatmonitor or it will default to pg_stat_statements with more limited output.

1 Like

Thank you Steve, I have added the pg_stat_monitor extension in the postgresql server, but i didn’t explicitly mention --query-source=pgstatmonitor while adding the client.

I used the below commands.

sudo pmm-admin config --server-insecure-tls --server-url=https://admin:<password>@pmm.example.com

sudo pmm-admin add postgresql --username='pmm' --password=<password>

So , i need to use the command like below?

sudo pmm-admin add postgresql --username='pmm' --password=<password> --query-source=pgstatmonitor

1 Like

Yes! If you first need to remove the node from monitoring to re-add it:

pmm-admin remove postgresql <service name>

you can get the service name by typing pmm-admin list

Then re-add with the command above. you’ll only have a small gap in metrics while you removed/re-added.

1 Like

Hi Steve,

I have created the pg_stat_monitor extension and able to see metrics collected from database. I have removed postgresql service and re-added with
pmm-admin add postgresql --username=‘postgres’ --password=xxxx --query-source=pgstatmonitor
But, Still I am unable to see query plan from QAN

-Siddesh

1 Like

Just got a response from one of the devs and he said it’s disabled by default as it adds some load to the system to capture this which may not be desired in all environments. you can get more detail about the configuration options here and you can see how to set the value here. Note that this config changes requires a postgres restart to take effect.

2 Likes

It worked, thank you @steve.hoffman

1 Like