6

What's the relation between:

innodb_buffer_pool_size and query_cache_*

Both are use for caching queries but what's the difference? Can I use both?

Thank you

HTF
  • 3,148
  • 14
  • 52
  • 82

2 Answers2

5

Buffer pool is for caching retrieved table and index data in memory, query cache just caches the parsed mysql queries and their results. The former is much larger and usually far more important. Sure you can use both.

johnshen64
  • 5,865
  • 24
  • 17
  • 3
    The query cache does not cache queries, it caches result sets from queries. (but the rest is correct). (cf Oracle where queries and their execution plans are cached). – symcbean May 30 '12 at 12:33
  • 1
    Thanks for adding that. Sorry I missed the result set, but in mysql the queries are cached along with the result set. – johnshen64 May 30 '12 at 13:13
0

innodb_buffer_pool_size = caches the tables for better response times

query_cache = for remembering queries to get them faster the next time you execute the same query

Richard de Wit
  • 243
  • 4
  • 12