The query cache lays at the server level, above individual engine
implementations, and thus affects all of them.
It (case-sensitively!) compares the current query with the queries in the
query cache, and if there's an EXACT match (including all parameter
positions, wheres, and whatnot), it returns the data immediately, thus
saving you the parse and execute steps. That's a lot of benefit, given that
you run the same identical query lots of times.
There will of course be some extra overhead when you enable it, but unless
you have some sort of data mining application that only executes every
individual query once and only once, you'll reap the benefits of it.
On Thu, Nov 12, 2009 at 10:00 AM, Aveek Misra <aveekm@stripped> wrote:
> I am using the innodb storage engine for a table that is used for a lot of
> SELECT's on columns that are defined as indexes. I have not enabled the
> query cache as of now since the innodb buffer pool already caches data and
> index information for InnoDB tables. So my question is - is the query cache
> used primarily for MyISAM tables or is it also useful for InnoDB tables
> (considering that the InnoDB has a buffer pool in place)? If I do enable the
> query cache, is there an additional overhead of maintaining two buffers that
> essentially contain the same data?
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1