简体   繁体   中英

Official MySQL Docker container not caching queries?

I tested the official MySQL Docker container (mysql:latest https://hub.docker.com/_/mysql/ ) with an about 500-700MB database.

While in my natively installed MySQL this database with one specific query takes about 1.5 seconds the first time, the following times take max. 100ms for the same query. In my docker container this "query caching" doesn't seem to apply. The same query always takes the same amount of time.

How do I enable query caching or how to I look up these MySQL settings to apply them to my MySQL docker?

Additional information: The query in question is an address search WHERE includes postal code, street name, house number, city I already indexed these columns for the search to work faster which already halved the query execution time.

mysql disabled query caching https://dev.mysql.com/doc/refman/5.7/en/query-cache-configuration.html

The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0.

Latest would include this

https://www.percona.com/blog/2015/08/07/mysql-query-cache-worst-enemy-best-friend/

I would recommend keeping it disabled if possible and have the application cache rather than the database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM