Skip to content


MySQL Query Cache

MySQL Query Cache

Will MySQL supports Query Caching?


The answer is “YES”

MySQL supports query caching if done some changes in the configuration file my.ini

Under [mysqld] section you can add,

query_cache_type
= #query_cache_value#

#query_cache_value # can be any of the following,

    query_cache_type = 0 => Caching is disabled

    query_cache_type = 1 => Caching is enabled for all queries

    query_cache_type = 2 => this requires adding the keyword SQL_CACHE to the queries that are to be cached


If defined “query_cache_type = 2”, then caching will be enabled for the queries which is mentioned SQL_CACHE in it.

SELECT SQL_CACHE column1, column2 FROM table_name;

SELECT SQL_CACHE name, age FROM employees;

For more information, Pls visit http://dev.mysql.com/doc/refman/6.0/en/query-cache.html



Posted in Uncategorized.

Tagged with , , , , , .



0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.