Results 1 to 3 of 3

Thread: Query Caches

  1. #1
    Join Date
    Aug 2010
    Posts
    1

    Unanswered: Query Caches

    Hi there,

    I'm trying to enhance and develop my skills in MySQL and wondered what the difference was between the two: query_cache_type 1 and 2?

    I can't get my head around it!

    Cheers,
    Sue

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Hi Sue,

    there are 3 possible settings:

    0 - off
    1 - on for all queries that except those that explicitly state not to cache the query and the results. SELECT SQL_NO_CACHE ...
    2 - off except for queries that explicitly state to be included in the query cache. SELECT SQL_CACHE ...

    Ronan
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    I have created a small demo to show the performance differences using the caching behaviour on MySQL. I created a table with 1,000,000 records and then attempted to group these. The query without caching takes approximately 1.75 seconds on my hardware platform but when caching is enabled the first iteration of the SQL takes 1.75 but subsequent queries takes 0.008 seconds. If you want a complete read of the post check it out here:

    MySQL query_cache_type IT Integrated Business Solutions
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •