An Entrepreneur, Coach, IT Consultant, Strategic Adviser, and a Traveler craving to explore and contribute to forming a better society.

Thursday, December 18, 2008

MySQL Query Cache

No comments :

MySQL Query Cache


(Explaining how to Query Caching in MySQL)


Keywords: MySQL, Caching, Query Caching, Query Optimization, Performance Optimization, MySQL Performance Optimization


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.

 

Example
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


Keywords: MySQL, Caching, Query Caching, Query Optimization, Performance Optimization, MySQL Performance Optimization


Featured Blog Topics:

No comments :