Well, you should be using a wrapper around your DB library class already
right? Like you don't use PEAR:DB directly, you have a wrapper class to
handle making a connection, doing the query, handling the error, etc.
Otherwise you're wasting a LOT of code/time. Not to mention it makes it
trivial to swap out the calls to another database library without chaning
all of YOUR code.

So all I did is wedge a logger/profiler into my sql_query() routine. This
has various levels of logging and saving the start/end times, etc. 

> -----Original Message-----
> From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On 
> Behalf Of Johan De Meersman
> Sent: Tuesday, July 13, 2010 1:17 AM
> To: Daevid Vincent
> Cc: Machiel Richards; mysql@lists.mysql.com
> Subject: Re: finding exact query being run
> 
> Which will still not be particularly helpful for subsecond queries :-)
> 
> Either turn on the full query log (beware of I/O 
> implications, use separate
> spindles if possible) or use mk-query-analyzer with tcpdump 
> to get a running
> analysis of what passes the line.
> 
> The addition of tcpdump support is my all-time favourite 
> feature of maatkit
> :-D
> 
> 
> On Tue, Jul 13, 2010 at 12:05 AM, Daevid Vincent 
> <dae...@daevid.com> wrote:
> 
> > get "mytop"
> >
> >
> >  _____
> >
> > From: Machiel Richards [mailto:machi...@rdc.co.za]
> > Sent: Monday, July 12, 2010 8:40 AM
> > To: mysql@lists.mysql.com
> > Subject: finding exact query being run
> >
> >
> >
> > Hi All
> >
> >
> >
> >                I am trying to find out how to see the exact 
> query being
> > run.
> >
> >
> >
> >                When running show processlit, I get a lot of 
> processes that
> > have been running for a VERY long time.
> >
> >
> >
> >                I a trying to find out exactly what query it 
> is that is
> > being run , any ideas?
> >
> >
> >
> >                I tried the slow query log but it is not 
> showing up in
> > there.
> >
> >
> >
> >                All the queries are showing "sleep"
> >
> >
> >
> >                Not sure if this means anything....
> >
> >
> >
> > Machiel Richards
> >
> > MySQL DBA
> >
> > Relational Database Consulting
> >
> >
> >
> > RDC_Logo
> >
> >
> >
> >
> 
> 
> -- 
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to