For years, I’ve been advocating that people put [DEBUG]( comments in their SQL statements to help identify performance bottlenecks in their applications. I feel so strongly about this that I’m absolutely nonplussed whenever I see a SQL query show-up in the MySQL slow-log or the process-list without a DEBUG statement. Recently, we installed FusionReactor at work; and, I was thrilled to see that my DEBUG statements were showing up in the database profiling that FusionReactor provides.

To see what I mean, let’s create a test ColdFusion page that executes a slow SQL query that will show up in FusionReactor’s slow transaction list. For this simulation, we can use MySQL’s SLEEP() command:


	dump( getPost( 3 ) );

	// ------------------------------------------------------------------------------- //
	// ------------------------------------------------------------------------------- //

	public array function getPost( required numeric id ) {

		// NOTE: We're using MySQL's SLEEP() command to simulate a performance bottleneck
		// in order to get this page to show up in FusionReactor's slow transaction log.
		var result = queryExecute(
			sql = "
				/* DEBUG: fusionReactorTesting.getPosts(). */

					-- Simulating a slow query, sleep for 5-seconds.
					( SLEEP( 5 ) ) AS temp
					blog_entry e
				WHERE = :id
			params = {
				id: { value: id, sqlType: "integer" }
			options = {
				returnType: "array"

		return( result );



#coldfusion #sql

Putting DEBUG Comments In Your SQL Statements Makes FusionReactor Query Tracing
1.10 GEEK