Na temat slowlogów dostępnych w MySQL pisałem jakiś czas temu – mowa wtedy była o logach, które są dostępne w dystrybucji MySQL udostępnianej przez twórców tego serwera. Przykładowy wpis w takim logu może wyglądać następująco:
# Time: 100505 12:57:11
# User@Host: root[root] @ localhost []
# Query_time: 0.183091 Lock_time: 0.000101 Rows_sent: 4 Rows_examined: 3034
SET timestamp=1273057031;
SELECT SQL_NO_CACHE * FROM film LEFT OUTER JOIN film_text USING (film_id) ORDER BY film.title, film_text.description LIMIT 30,4;
# User@Host: root[root] @ localhost []
# Query_time: 0.183091 Lock_time: 0.000101 Rows_sent: 4 Rows_examined: 3034
SET timestamp=1273057031;
SELECT SQL_NO_CACHE * FROM film LEFT OUTER JOIN film_text USING (film_id) ORDER BY film.title, film_text.description LIMIT 30,4;
Wpis w logu dla tego samego zapytania w przypadku stosowanej przeze mnie wersji MySQL wygląda następująco:
# Time: 100505 12:54:13
# User@Host: root[root] @ localhost []
# Thread_id: 4249 Schema: sakila
# Query_time: 0.165546 Lock_time: 0.000081 Rows_sent: 4 Rows_examined: 3034 Rows_affected: 0 Rows_read: 34
# Bytes_sent: 2262 Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: 1750700
# QC_Hit: No Full_scan: Yes Full_join: No Tmp_table: Yes Tmp_table_on_disk: Yes
# Filesort: Yes Filesort_on_disk: No Merge_passes: 0
# InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
# InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
# InnoDB_pages_distinct: 12
SET timestamp=1273056853;
SELECT SQL_NO_CACHE * FROM film LEFT OUTER JOIN film_text USING (film_id) ORDER BY film.title, film_text.description LIMIT 30,4;
# User@Host: root[root] @ localhost []
# Thread_id: 4249 Schema: sakila
# Query_time: 0.165546 Lock_time: 0.000081 Rows_sent: 4 Rows_examined: 3034 Rows_affected: 0 Rows_read: 34
# Bytes_sent: 2262 Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: 1750700
# QC_Hit: No Full_scan: Yes Full_join: No Tmp_table: Yes Tmp_table_on_disk: Yes
# Filesort: Yes Filesort_on_disk: No Merge_passes: 0
# InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
# InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
# InnoDB_pages_distinct: 12
SET timestamp=1273056853;
SELECT SQL_NO_CACHE * FROM film LEFT OUTER JOIN film_text USING (film_id) ORDER BY film.title, film_text.description LIMIT 30,4;