J
J
Jack OXO2016-07-04 10:29:03
MySQL
Jack OXO, 2016-07-04 10:29:03

How to analyze mysql query log?

The hoster gave a log of queries to the database. How can they be analyzed to identify severe ones?
Here is an example log:

09:58:30.061042 munmap(0x2b56d797b000, 274) = 0
09:58:30.061071 close(3)                = 0
09:58:30.061126 lstat("/home/b/.../public_html/libraries/vendor/composer/autoload_psr4.php", {st_mode=S_IFREG|0644, st_size=1698, ...}) = 0
09:58:30.061176 open("/home/b/../public_html/libraries/vendor/composer/autoload_psr4.php", O_RDONLY) = 3
09:58:30.061213 fstat(3, {st_mode=S_IFREG|0644, st_size=1698, ...}) = 0
09:58:30.061249 fstat(3, {st_mode=S_IFREG|0644, st_size=1698, ...}) = 0
09:58:30.061283 fstat(3, {st_mode=S_IFREG|0644, st_size=1698, ...}) = 0
09:58:30.061318 mmap(NULL, 1698, PROT_READ, MAP_SHARED, 3, 0) = 0x2b56d797b000
09:58:30.061362 stat("/home/b/../public_html/libraries/vendor/composer/autoload_psr4.php", {st_mode=S_IFREG|0644, st_size=1698, ...}) = 0
09:58:30.061407 munmap(0x2b56d797b000, 1698) = 0
09:58:30.061436 close(3)                = 0
09:58:30.061534 lstat("/home/b/../public_html/libraries/vendor/composer/autoload_classmap.php", {st_mode=S_IFREG|0644, st_size=1352, ...}) = 0
09:58:30.061586 open("/home/b/../public_html/libraries/vendor/composer/autoload_classmap.php", O_RDONLY) = 3
09:58:30.061624 fstat(3, {st_mode=S_IFREG|0644, st_size=1352, ...}) = 0
09:58:30.061659 fstat(3, {st_mode=S_IFREG|0644, st_size=1352, ...}) = 0
09:58:30.061694 fstat(3, {st_mode=S_IFREG|0644, st_size=1352, ...}) = 0
09:58:30.061729 mmap(NULL, 1352, PROT_READ, MAP_SHARED, 3, 0) = 0x2b56d797b000
09:58:30.061773 stat("/home/b/../public_html/libraries/vendor/composer/autoload_classmap.php", {st_mode=S_IFREG|0644, st_size=1352, ...}) = 0
09:58:30.061824 munmap(0x2b56d797b000, 1352) = 0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly, 2016-07-04
@vshvydky

grep or awk

P
Pavel Ivanov, 2016-07-04
@eastywest

This is not a database query log, this is the strace output.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question