I know using UNIX_TIMESTAMP() will cause MySQL to not cache the query, which is reasonable. But, if I use UNIX_TIMESTAMP() to convert a DATETIME-column, will it also miss the cache?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It will still be cached if you pass a value or column as a parameter to
UNIX_TIMESTAMP().It is also worth knowing in case you weren’t aware, that any changes to your table result in the cache being cleared. So if the table you are querying changes frequently, you probably aren’t having much if any benefit of the query cache.
From the 5.5 manual: