On Fri, Sep 16, 2011 at 02:31:37PM -0400, Jay Ashworth wrote:
> ----- Original Message -----
> > From: "Kevin Falcone" <[email protected]>
> 
> > That doesn't looks like a standard RT query, but you haven't provided
> > your version. You'll probably want to turn on the StatementLog option
> > and figure out where that query is coming from so you can fix the
> > source.
> 
> Which makes you a good person for me to bounce a SQL idea off of:
> 
> For the purpose of tracing queries back into code, how about something like:
> "add to the end of each query a clause like AND NOT Todays_Date = '1000-08-22'
> (using the appropriate SQL syntax, which I forget)... using the date as an
> 'address' for the query in the code (program, module, query, or something 
> similar."
> 
> The entire clause will be statically true, and get optimized off, but will
> still show up in the slow-query log, and in mytop/mtop, etc... giving you 
> a handle to get back to the code.
> 
> Is this possible?  Practical?

This destroys mysql's query cache, which is a very nice performance win.  

On RT4 you can enable the statement log and see every query run
on a page with pointers into the source that executed it.

-kevin

Attachment: pgpzsbstz4BAu.pgp
Description: PGP signature

--------
RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26 & 27, 2011
*  San Francisco, CA, USA — October 18 & 19, 2011
*  Washington DC, USA — October 31 & November 1, 2011
*  Melbourne VIC, Australia — November 28 & 29, 2011
*  Barcelona, Spain — November 28 & 29, 2011

Reply via email to