Free tools Windows power users keep installed
One-click scans. No signup required.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
MySQL’s slow query log is disabled by default. To capture slow statements, enable slow_query_log, make sure log_output includes FILE (or deliberately choose TABLE), and set a useful long_query_time. If the log is enabled but empty, the usual causes are log_output=NONE, a threshold that your test query does not exceed, an unmet min_examined_row_limit, or filters that exclude administrative and no-index statements.
This guide shows the runtime and startup configuration, explains where the file is written, provides a systematic fix for an empty or rapidly growing log, and shows how to turn entries into safer index and SQL changes.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsWhat the slow query log records
The slow query log is a diagnostic stream of SQL statements that exceed the configured execution-time threshold and, under the documented rule, examine at least the configured minimum number of rows. MySQL’s official wording is: “The slow query log consists of SQL statements that take more than long_query_time seconds to execute and require at least min_examined_row_limit rows to be examined.”
It is separate from the general query log. The general log records accepted statements broadly, while the slow log is intended to identify work that deserves performance investigation. A slow-log entry includes timing and row-count fields such as:
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Query_time: elapsed execution time.Lock_time: time spent waiting for locks.Rows_sent: rows returned to the client.Rows_examined: rows MySQL inspected while executing the statement.
A large difference between rows examined and rows sent can indicate inefficient filtering, a missing or poorly ordered index, or a plan that is unsuitable for the statement’s parameter values. It is a prioritization clue, not proof that an index is required; confirm the cause with an execution plan.
Check the current configuration first
Run this query before changing anything. It records the effective global settings on the server you are troubleshooting:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →SHOW GLOBAL VARIABLES WHERE Variable_name IN (
'slow_query_log','slow_query_log_file','log_output','long_query_time',
'min_examined_row_limit','log_queries_not_using_indexes',
'log_slow_admin_statements','log_throttle_queries_not_using_indexes'
);
Interpret the result as a set rather than checking only one variable:
slow_query_logmust beONfor capture to occur.log_outputdetermines the destination.FILEwrites a file,TABLEwrites tomysql.slow_log, andNONEsuppresses query output.slow_query_log_fileidentifies the file name or path used for file output.long_query_timeis the execution-time threshold. Its documented default is 10 seconds.min_examined_row_limitadds a rows-examined requirement. A query can exceed the time threshold and still be omitted if it examines fewer rows than this value.log_queries_not_using_indexescontrols whether statements that do not use indexes are included.log_slow_admin_statementscontrols logging of qualifying administrative statements.log_throttle_queries_not_using_indexeslimits bursts created by no-index queries.
Use SHOW GLOBAL, not a session-only value, when diagnosing what the server is applying to new connections. A setting changed only for your session will not enable the server-wide log.
Enable the log immediately at runtime
Runtime changes are useful for a bounded diagnostic window because they take effect without restarting the server. The account issuing SET GLOBAL must have the privileges required by your MySQL version and deployment.
Write entries to a file
For ordinary file-based troubleshooting, select FILE, enable the logger, and choose a threshold:
SET GLOBAL log_output = 'FILE';
SET GLOBAL slow_query_log = ON;
SET GLOBAL long_query_time = 1;
This example captures statements taking more than one second. One second is a diagnostic choice, not a universal production setting. On a busy system it can generate a substantial volume, so use the lowest threshold that answers the question and return it to a sensible value afterward.
Choose a specific file
Where the server permits it, set the global slow_query_log_file variable:
SET GLOBAL slow_query_log_file = '/var/log/mysql/app-slow.log';
When the file name changes, MySQL closes the already open slow-log file and opens the new one. Confirm the resulting value with:
SELECT @@global.slow_query_log_file;
The path must be valid on the database server’s host, not on the workstation from which you run the SQL client. The MySQL service account also needs permission to create or write the file and to traverse each directory in the path.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Use the internal slow-log table instead
If you prefer SQL access to the records, include TABLE in log_output:
SET GLOBAL log_output = 'TABLE';
SET GLOBAL slow_query_log = ON;
Entries are written to mysql.slow_log. A deployment can include more than one destination, for example FILE,TABLE, when both a file and SQL queries are needed. Be deliberate: every enabled destination receives the captured entries and therefore adds storage or maintenance work.
Make the configuration persistent across restarts
SET GLOBAL changes are generally runtime changes. A restart, package upgrade, container replacement, or managed-service operation can restore the startup configuration. To keep the setting, add the equivalent server options to the MySQL option file or launch configuration used by your installation:
slow_query_log=ON
slow_query_log_file=/var/log/mysql/app-slow.log
log_output=FILE
long_query_time=1
The exact option-file location and persistence mechanism differ by operating system, package, container image, and managed MySQL service. Edit the configuration source that actually launches your server, then restart it according to that environment’s procedure. Afterward, repeat the SHOW GLOBAL VARIABLES query and confirm that the effective values match the file. A setting added to an unused option file will appear to have no effect even though its syntax is correct.
For a short investigation, runtime configuration avoids a restart and limits the chance of accidentally leaving a diagnostic threshold in production. For a permanent policy, startup configuration prevents the logger from silently disappearing after the next restart.
Set thresholds and capture scope deliberately
long_query_time
long_query_time is the main execution-time filter. The documented default is 10 seconds, which is often too high to reveal user-facing latency in a responsive application. Lowering it to one second, or to another value based on your service-level objective, makes the log more useful for an investigation.
Do not set it to zero casually. A near-zero threshold can record almost every statement, creating I/O, storage, and review costs and making important entries harder to find. Use a defined observation period, collect enough representative traffic, then restore the threshold.
min_examined_row_limit
This variable is a second eligibility test. If it is set above zero, a statement must examine at least that many rows in addition to exceeding long_query_time. For a controlled test, inspect its value and temporarily lower it if you need to observe low-row-count statements. Keep the change tied to the diagnostic interval so that the production policy remains intentional.
No-index queries
By default, queries that do not use indexes are excluded from the slow log unless they meet the normal slow-query criteria and the relevant option is enabled. To broaden capture, set:
SET GLOBAL log_queries_not_using_indexes = ON;
This option can be noisy on workloads that legitimately scan small tables. If you enable it, use log_throttle_queries_not_using_indexes to limit bursts:
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
SET GLOBAL log_throttle_queries_not_using_indexes = 10;
The number is the throttle limit you choose for the deployment; select it according to traffic and the volume you can safely review. Throttling limits repeated no-index entries but does not make an inefficient query efficient.
Administrative statements
Administrative statements are excluded by default. To include qualifying administrative work, enable:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →SET GLOBAL log_slow_admin_statements = ON;
Use this when maintenance, table operations, or other administrative activity is part of the latency problem. It is not necessary for ordinary application SELECT, INSERT, UPDATE, and DELETE analysis.
Find the file and verify that MySQL can write it
Never guess the file location. Read the server’s effective value:
SELECT @@global.slow_query_log_file;
If the value is an absolute path, inspect that exact directory on the database host. If it is not absolute, MySQL uses its data directory together with a default host-based file name. The file may therefore be in the data directory rather than in a distribution’s commonly assumed log directory.
Check all of the following on the server host:
- The parent directory exists.
- The MySQL service account can traverse the directory and create or append to the file.
- Mandatory access-control policies, such as a host security profile, allow the service to write there.
- The filesystem has free space and the file has not hit an operational quota.
- You are inspecting the active database host, not a replica, container shell, or client machine.
After generating a deliberately slow test in a safe environment, refresh the file and check for a new timestamp or entry. Avoid running an expensive query merely to test logging on a production system; use an existing representative statement or a controlled test that will not damage availability.
Recommended Free Tools
Why an enabled slow log is empty
log_output is NONE
slow_query_log=ON does not guarantee file output. If log_output=NONE, MySQL writes no query entries even though the slow-log switch is enabled. Set log_output='FILE' for a file or log_output='TABLE' for mysql.slow_log, then verify the value again.
The test does not cross the filters
Check long_query_time and min_examined_row_limit. A statement that completes below the time threshold, or examines fewer rows than the minimum, is correctly absent. Remember that the threshold concerns execution time on the server; time spent waiting in an application, connection pool, network, or client is not automatically represented as query execution time.
The statement is excluded by scope
Administrative statements and no-index statements are not included by default. Enable log_slow_admin_statements or log_queries_not_using_indexes only when that is the behavior you need. For no-index capture, configure throttling as well if the workload can produce a burst.
You are reading the wrong destination
With TABLE, the records are in mysql.slow_log, not in the file named by slow_query_log_file. With multiple destinations, check each one. Query the table directly when that is the selected output:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
SELECT start_time, query_time, lock_time, rows_sent, rows_examined, sql_text
FROM mysql.slow_log
ORDER BY start_time DESC
LIMIT 20;
The exact columns available can vary with MySQL version, so inspect the table definition if a column in the example is unavailable.
Why the file cannot be found or opened
Start with @@global.slow_query_log_file, then distinguish a wrong path from a permissions failure. A relative file name resolves under MySQL’s data directory; an absolute name points elsewhere. If the directory exists but the file never appears, inspect ownership, directory permissions, security policy, disk space, and service logs. A path that is writable by your interactive shell may still be unwritable by the account running mysqld.
Changing the global file variable causes MySQL to close the current file and open the new one. If the new path is invalid or inaccessible, correct the directory and permissions, set the variable again, and confirm the effective value. Do not delete the active file while the server is writing to it; use your platform’s supported log rotation process or change the file name first.
Control a log that grows too quickly
A fast-growing log usually reflects an intentionally broad capture setting rather than a broken logger. The most common triggers are lowering long_query_time toward zero and enabling log_queries_not_using_indexes on a high-volume workload.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- Record the current values of
long_query_time,log_queries_not_using_indexes, andlog_throttle_queries_not_using_indexes. - Limit the diagnostic interval and monitor disk usage while collecting data.
- Restore a useful threshold when you have enough samples.
- Leave no-index logging disabled unless it answers a specific question, or retain it with a deliberate throttle.
- Archive or rotate the completed file according to your operating system and retention policy.
The slow log is itself workload. Writing, storing, rotating, and later parsing every entry consumes resources. There is no universal overhead percentage that applies to all MySQL versions and workloads, so measure the effect in your environment rather than relying on a generic number.
Replication: why a replica may not show statements
Replicas do not log replicated queries by default. In MySQL 8.0.26 and later, the relevant option is log_slow_replica_statements. Earlier releases use log_slow_slave_statements. Configure the option on the replica where you need visibility, and verify the release-specific variable name before changing it.
Row-based replication limits the effect of these settings because the replica applies row events rather than replaying the original SQL statement in the same way as statement-based replication. Consequently, a primary’s slow log and a replica’s apply workload answer different questions. Check the server and replication format before concluding that missing replica entries indicate a logging failure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Summarize entries and choose what to fix first
Reading a large file line by line is inefficient. MySQL ships mysqldumpslow to summarize recurring statements. For the 20 statements with the greatest total time, use:
mysqldumpslow -s t -t 20 /path/to/host-slow.log
The path must be the active file on the server or a copy you have exported for analysis. Grouping normalizes similar statements so that repeated work is visible even when literal values differ.
Prioritize candidates using four signals:
- Total time: repeated moderate delays can cost more than one rare, very slow statement.
- Frequency: a statement executed thousands of times may deserve attention before a one-off operation.
- Rows examined: high values suggest excess scanning or filtering work.
- Rows sent: compare this with rows examined to see whether the server does much more work than the client receives.
A high rows-examined-to-rows-sent gap combined with high repetition is a strong candidate for investigation. It is not a license to add an index blindly: writes must maintain every additional index, indexes consume storage, and a new index can destabilize plans for other parameter values.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Investigate a representative statement
Take a real statement pattern from the summary and run an execution plan with representative parameters:
EXPLAIN SELECT ...;
Use the deployed MySQL version’s execution-analysis facility where it is supported and where the additional execution work is safe. Compare the plan with the observed slow-log fields. Look for full scans on large tables, joins that examine many rows before filtering, predicates that cannot use the available index, unnecessary sorting or temporary tables, and estimates that differ greatly from actual work.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Test one change at a time against realistic data and concurrency. A plan that improves a small development dataset can regress in production when cardinality, parameter distribution, or concurrent writes differ.
Remediation options and their trade-offs
| Option | When it helps | Costs and risks to check | How to validate |
|---|---|---|---|
| Add or adjust an index | Filtering, joining, or ordering repeatedly scans many rows that could be narrowed by a selective key. | Extra storage and write maintenance; possible duplicate or redundant indexes; plan changes for other queries. | Compare execution plans, rows examined, write latency, and slow-log recurrence before and after. |
| Rewrite SQL | Predicates, joins, subqueries, sorting, or selected columns force unnecessary work. | Different semantics, changed locking behavior, and regressions for other parameter values. | Run correctness tests and compare plans and timings under representative parameters. |
| Change schema or data access pattern | Repeated aggregation, archival, or access patterns cannot be served efficiently by the current design. | Migration complexity, backfill time, application changes, and operational risk. | Measure the complete request path, not only the isolated query. |
| Adjust server logging thresholds | The immediate need is better diagnosis or less diagnostic volume. | It does not make a query faster; broad capture adds I/O, storage, and review work. | Confirm the intended entries are captured and return to a sustainable threshold. |
Use the slow log to identify and verify a problem, not as a substitute for an execution plan. The best fix reduces latency and rows examined without creating unacceptable write cost, storage use, plan instability, or deployment risk.
A repeatable troubleshooting checklist
- Run the global-variable query and save the current values.
- Confirm
slow_query_log=ON. - Confirm
log_outputincludes the destination you are checking. - Read
@@global.slow_query_log_fileif using file output. - Check
long_query_timeandmin_examined_row_limitagainst the statement you expect to capture. - Decide whether administrative or no-index statements need explicit inclusion.
- Verify the server host, service-account permissions, security policy, and free disk space.
- Generate or observe a safe, representative test during a bounded interval.
- Summarize recurring statements with
mysqldumpslow. - Use
EXPLAINand version-supported execution analysis before changing SQL or indexes. - Test the change under realistic data and concurrency.
- Restore thresholds, disable temporary broad-capture options, and retain only the startup settings you intend to operate.
Conclusion
Enabling the MySQL slow query log is a three-part configuration task: turn on slow_query_log, select an output destination, and choose thresholds that match the diagnostic question. An empty log is usually explained by the destination, threshold, row-count filter, statement category, or an incorrect file path—not by the logger switch alone. Once entries appear, summarize recurring work, validate representative statements with execution plans, and weigh latency gains against index write cost, storage, plan stability, and operational risk.
Frequently Asked Questions
Does setting slow_query_log=ON automatically create a file?
No. File output requires log_output to include FILE. If output is TABLE, records go to mysql.slow_log; if it is NONE, no query entries are written.
What is the default MySQL slow-query threshold?
The documented default for long_query_time is 10 seconds. A statement must also satisfy min_examined_row_limit when that value is greater than zero.
Why is a query that does not use an index missing from the log?
No-index queries are excluded by default. Enable log_queries_not_using_indexes for that diagnostic purpose, and consider log_throttle_queries_not_using_indexes to limit bursts.
Why can a replica lack slow-log entries for replicated work?
Replicas do not log replicated queries by default. MySQL 8.0.26 and later use log_slow_replica_statements; earlier releases use log_slow_slave_statements. Row-based replication also limits what these settings reveal.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.

