Report this

What is the reason for this report?

Is there a slow query log for a managed database?

Posted on December 2, 2019

I want to tune my application and for this I want to see the slow running queries. Is this available for a postgres managed database?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Contacted support regarding this. Their answer:

Since the database is managed on our end it isn’t possible to access the cluster to enable slow_query_log directly.

The general_log and slow_query_log_file can be seen under the “Queries” sub-tab of your database cluster.

The long_query_time is set to 10.000000

Regarding changing long_query_time:

Currently, it is not possible to edit the the same. We are looking at this for the future but at this time it’s not possible.

Just checking in on this one. No way to sort or filter the queries. It’s not very useful if you can’t differentiate queries < 100ms from slow queries.

Just wanted to share that this is now possible with the managed MySQL database cluster, so it may be possible with postgres as well.

I used the HTTP API to enable the slow query log (docs), then I could access the slow query log via the slow_queries table in the mysql schema/database.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.