Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate MySQL Query Memory/CPU Cost

Is there a way/tool/technique to calculate the processor and memory cost of a specific MySQL query?

like image 348
Lashae Avatar asked Dec 13 '09 22:12

Lashae


People also ask

How does MySQL calculate memory?

Mysql Server Memory Usage = Sum of Global Buffers + (number of Connection * Per thread memory variables). Global buffers include: key_buffer_size: key_buffer_size is the size of the buffer used for index blocks.

Which query is taking up more CPU MySQL?

You can use Performance Insights to identify the exact queries that are running on the instance and causing high CPU usage. First, activate Performance Insights for MySQL. Then, you can use Performance Insights to optimize your workload. Be sure to consult with your DBA.

How much memory does MySQL use?

The default configuration is designed to permit a MySQL server to start on a virtual machine that has approximately 512MB of RAM. You can improve MySQL performance by increasing the values of certain cache and buffer-related system variables.


1 Answers

Check this sample:

sample at mysql.com

like image 85
pipelinecache Avatar answered Sep 18 '22 08:09

pipelinecache