List:General Discussion« Previous MessageNext Message »
From:Ewen Fortune Date:November 18 2010 12:56pm
Subject:Re: Does mysql cache strip out /* comments */ first?
View as plain text  
Daevid,

<snip>
> My concern is, my gut tells me that the built in mysql cache system is
> "dumb". And by that I mean, I suspect that mySQL isn't "smart" enough to
> strip out comments from the SQL statement string BEFORE storing it as the
> cache hash key (yet I have no facts either way to back it up and hence the
> reason for this email).
>
> http://dev.mysql.com/doc/refman/5.0/en/query-cache.html
> http://dev.mysql.com/tech-resources/articles/mysql-query-cache.html
>
> Can anyone please tell me I'm wrong and that it is smarter than I give it
> credit for, as I think this would be a very useful "feature" (or bug-fix as
> the case may be).

Your suspicions are correct, the query cache does not strip comments
before storing the statement.

This can however be done in the Percona build.

http://www.percona.com/docs/wiki/percona-server:features:query_cache_enhance#query_cache_strip_comments
http://www.percona.com/docs/wiki/percona-server:features:implementation_details:details_query_cache_with_comments

Cheers,

Ewen
Thread
Does mysql cache strip out /* comments */ first?Daevid Vincent18 Nov
  • Re: Does mysql cache strip out /* comments */ first?Johan De Meersman18 Nov
    • RE: Does mysql cache strip out /* comments */ first?andrew.2.moore18 Nov
      • Re: Does mysql cache strip out /* comments */ first?Johan De Meersman18 Nov
  • Re: Does mysql cache strip out /* comments */ first?Ewen Fortune18 Nov
    • RE: Does mysql cache strip out /* comments */ first?Daevid Vincent18 Nov
      • Re: Does mysql cache strip out /* comments */ first?Ewen Fortune18 Nov
        • Re: Does mysql cache strip out /* comments */ first?Waynn Lue19 Nov