List:General Discussion« Previous MessageNext Message »
From:Homam S.A. Date:March 29 2005 5:17am
Subject:Why doesn't MySQL cache queries that start with parenthesis? (further info)
View as plain text  
It seems that MySQL freaks out whenever it seems
something that looks like a derive table and refuses
it to cache. Even a non-UNION query like:

SELECT * FROM 
(SELECT * FROM X WHERE A = 5) AS DerivedTable

Won't be cached.

I read a comment in the documentation that if you put
SQL_CACHE in the SELECTs of the parenthesized queries,
it will cache the individual queries:

http://dev.mysql.com/doc/mysql/en/query-cache.html

That's not true. It won't cache even the parenthsized
queries, and the execution time is still the same with
SQL_CACHE and not. I have the query cache configured
to cache every query unless I explicitly tell not to,
so there's nothing in my configuration that prevents
from caching.

This is very frustrating. It seems everything time I
find a solution to an obstacle, I stumble across a
nastier one.

Thread
Why doesn't MySQL cache queries that start with parenthesis? (further info)Homam S.A.29 Mar
  • Re: Why doesn't MySQL cache queries that start with parenthesis? (further info)Sergei Golubchik29 Mar
    • MSSQL Import from MySQLAndrew Maynes29 Mar
      • Re: MSSQL Import from MySQLMartijn Tonies29 Mar