Slow Query Log — Concept Check
Questions on Slow Query Log. Enable slow_query_log with a long_query_time threshold to capture expensive queries; use mysqldumpslow or pt-query-digest to identify and rank the worst offenders.
Questions in this quiz
7 questions on Slow Query Log — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A database administrator notices that the slow query log is not capturing any queries even though it is enabled. What could be the reason?
- AThe database server needs a restart.
- BThe slow_query_log_file path is incorrect.
- CThe log_queries_not_using_indexes is off.
- DThe long_query_time is set too high.
2.After enabling the slow query log, you notice a large number of queries logged with full-table scans. What should you check first?
- AConfirm the server has been restarted.
- BEnsure mysqldumpslow is installed.
- CVerify if log_queries_not_using_indexes is enabled.
- DCheck if the slow_query_log_file has enough space.
3.Which tool would you use for a detailed statistical analysis of slow queries, including percentiles and standard deviation?
- ASHOW VARIABLES
- Bpt-query-digest
- Cmysqldumpslow
- DEXPLAIN ANALYZE
4.A developer sets long_query_time to 0.1 seconds but notices no improvement in performance. Why might this setting be ineffective?
- AThe server needs a restart to apply changes.
- BThe slow query log is not enabled.
- CThe threshold is too low, causing log flooding.
- DThe queries are using indexes efficiently.
5.What is the primary purpose of setting log_queries_not_using_indexes to ON?
- ATo catch queries that perform full-table scans.
- BTo capture all queries regardless of execution time.
- CTo reduce the size of the slow query log.
- DTo automatically optimize queries.
6.A DBA uses mysqldumpslow to analyze the slow query log. What can they sort the queries by?
- AQuery complexity
- BTotal execution time
- CExecution plan
- DIndex usage
7.How can a DBA verify that the slow query log settings have been applied correctly?
- AUsing SHOW VARIABLES LIKE 'slow_query%'.
- BBy running EXPLAIN on logged queries.
- CBy restarting the MySQL server.
- DBy checking the slow query log file size.