I''m looking for a way to find the cumulative time taken by database queries. In other words, I''m trying to find out which queries have the biggest overall impact on application performance. I need an approach that works with ActiveRecord 2.1.2 and MySQL 5.1. I have no qualms hacking into ARec myself, but I''d prefer an existing solution if one exists. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Nov-23 13:10 UTC
Re: Determine which queries eat most cumulative time
On Nov 23, 12:24 pm, Michael Schuerig <mich...-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> I''m looking for a way to find the cumulative time taken by database > queries. In other words, I''m trying to find out which queries have the > biggest overall impact on application performance. > > I need an approach that works with ActiveRecord 2.1.2 and MySQL 5.1. I > have no qualms hacking into ARec myself, but I''d prefer an existing > solution if one exists. >If you set the slow query log time to 0 then there are various tools that will analyze your queries for you eg http://www.maatkit.org/doc/mk-query-digest.html or http://www.mysqlperformanceblog.com/2006/09/06/slow-query-log-analyzes-tools/ (this will obviously dump a lot of data to your slow query log so you don''t want this running 24/7) Fred> Michael > > -- > Michael Schuerig > mailto:mich...-q5aiKMLteq5BV9CJdY2HSA@public.gmane.org://www.schuerig.de/michael/-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Schuerig
2010-Nov-23 14:17 UTC
Re: Determine which queries eat most cumulative time
On Tuesday 23 November 2010, Frederick Cheung wrote:> On Nov 23, 12:24 pm, Michael Schuerig <mich...-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote: > > I''m looking for a way to find the cumulative time taken by database > > queries. In other words, I''m trying to find out which queries have > > the biggest overall impact on application performance. > > > > I need an approach that works with ActiveRecord 2.1.2 and MySQL > > 5.1. I have no qualms hacking into ARec myself, but I''d prefer an > > existing solution if one exists. > > If you set the slow query log time to 0 then there are various tools > that will analyze your queries for you eg > http://www.maatkit.org/doc/mk-query-digest.html or > http://www.mysqlperformanceblog.com/2006/09/06/slow-query-log-analyz > es-tools/ (this will obviously dump a lot of data to your slow query > log so you don''t want this running 24/7)Thanks. mk-query-digest with full logging is the best option, AFAICT. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.