Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud SQL's Query Insights 'UTILITY COMMAND' costs

Postgres 12.8 cluster(1 writer, 1 reader) hosted on GCP.

Whenever I got a CPU spike 'On READER instance' and dig-in 'Query Insights' for costly queries, every time the most costly operation is UTILITY COMMAND.

I searched for UTILITY COMMAND and only got this

Can someone guide me how to dig inside 'UTILITY COMMAND' and how to make it less costly on READER instance?

like image 918
wing_man Avatar asked Jan 29 '26 09:01

wing_man


1 Answers

This question was posted a long time ago. Since it is hard to get information about UTILITY COMMAND in Google Cloud SQL Query Insights, I am going to post an answer. According to Google technical support:

The UTILITY COMMAND is a classification for all queries not defined as SELECT, UPDATE, INSERT, or DELETE, in Query Insights.

This UTILITY COMMAND also includes maintenance operations like VACUUM and table commands like CREATE, DROP, and COPY.

So this is not an issue to be avoided, this is a group of different queries instead of the ones shown above and maintenance operations, all in just one place.

I found this on a GitHub thread on an issue here.

Since Cloud SQL is a managed service by Google, I guess there is not much that we can do to reduce its cost.

like image 134
Amin Gheibi Avatar answered Jan 31 '26 02:01

Amin Gheibi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!