Earlier quoted context omitted.
Most, if not all production mysql installations have this cache disabled anyways. (Based on my experience at Engine Yard for 3 years and other places the last 5 years.)
Why?
MySQL query comments in Rails
11–20 of 21 posts
Re: MySQL query comments in Rails
#12Re: MySQL query comments in Rails
#13I dig this, a lot. Anyone know if there's a Django equivalent yet? If not, I know what I'll be doing with at least one evening this week...
Playfire has released something that will tack a comment onto all your queries for you: https://github.com/playfire/django-append-url-to-sql/
Re: MySQL query comments in Rails
#14Re: MySQL query comments in Rails
#15Re: MySQL query comments in Rails
#16Does anyone know if this exists for postgres?
Re: MySQL query comments in Rails
#17A similar thing I've tried to get implemented at a number of previous jobs is to dump the session ID in a SQL comment when issuing a query. We've had the session ID in application logs forever, but no way of correlating DB activity with application activity; this would fix that and allow a posteriori full-stack instrumentation.
Re: MySQL query comments in Rails
#18Earlier quoted context omitted.
Most, if not all production mysql installations have this cache disabled anyways. (Based on my experience at Engine Yard for 3 years and other places the last 5 years.)
Why?
Of course its a trade-off. If you have have substantially more reads than writes than it might be OK for your needs.
Re: MySQL query comments in Rails
#19Does anyone know if this exists for postgres?
Re: MySQL query comments in Rails
#20Note that adding comments to otherwise identical queries will typically cause the MySQL query cache to not realize they are the same. See: http://www.mysqlperformanceblog.com/2008/03/20/mysql-query-c... Otherwise, neat idea, I like it.
Most, if not all production mysql installations have this cache disabled anyways. (Based on my experience at Engine Yard for 3 years and other places the last 5 years.)