Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL 8 Warning: SQL_NO_CACHE is deprecated

When issuing a statement to MySQL8 server:

SELECT SQL_NO_CACHE *
FROM <table-name>;

I get this warning:

Warning, 1681, 'SQL_NO_CACHE' is deprecated and will be removed in a future release.

I would like to ask if there is any successor of the SQL_NO_CACHE that works or is planned to work with MySQL 8.x?

Does SQL_NO_CACHE actually work with MySQL 8.x or it is omitted by the server?

like image 674
Jimmix Avatar asked Oct 24 '25 02:10

Jimmix


2 Answers

https://dev.mysql.com/worklog/task/?id=10837 says:

Since 8.0 still has (i.e. silently ignores) the SQL_NO_CACHE syntax and always returns false on the have_query_cache variable, maintain deprecation warnings for both like we do in 5.7 for a while.

more readings on this subject: https://mysqlserverteam.com/mysql-8-0-retiring-support-for-the-query-cache/

"Although MySQL Query Cache was meant to improve performance, it has serious scalability issues and it can easily become a severe bottleneck."

and

"The query cache has been disabled-by-default since MySQL 5.6 (2013)"

like image 101
Luuk Avatar answered Oct 27 '25 00:10

Luuk


Just noticed it, damn it was so useful -_- Keep using it until it's removed or try SELECT column, now() FROM myTable instead. I suppose the call will force mysql to not use the cache.

like image 44
carte-sd Avatar answered Oct 26 '25 23:10

carte-sd