If you have a table with many INSERT
s and also frequent SELECT
s, it's common to see INSERT
operations waiting for cache, which can cause delays. This happens because SELECT
queries can lock or slow down INSERT
s. A good practice is to use SQL_NO_CACHE
in SELECT
statements on tables with heavy insert activity. InnoDB also recommends using uncached queries in such cases. Of course, if your workload is mostly SELECT
s and rarely updated, caching is beneficial — especially when the query cache hit ratio is over 90%. But for large tables with frequent inserts, it's better to disable caching for those SELECT
s using SQL_NO_CACHE
. Disabling the whole query cache isn't ideal unless you're ready to redesign the software (e.g. using Redis), so using SQL_NO_CACHE
is a simple and effective optimization for improving INSERT
performance.