[frs-378] Using FR QueryPlan when runing QueryPlan yourself

Problem

Running queries against a MSSQL database when FusionReactor has the QueryPlan feature enabled.

When FusionReactor runs the QueryPlan, it runs a specific set of queries depending on which database you are connecting to. However unlike the other databases Microsoft SQL Server requires a flag to be enabled in order to get the explain data. This results in FusionReactor having to run 3 statements to gather the explain data for MSSQL.

SQL for Microsoft SQL Server explain
  SET SHOWPLAN_TEXT ON; 
  SELECT * FROM table; 
  SET SHOWPLAN_TEXT OFF;

If you have already turned on SHOWPLAN_TEXT ON then FusionReactor will turn it off when it has completed it's execution of the query plan.

Solution

The solution to this is to change the template that FusionReactor uses to execute the QueryPlan to not turn on or off the SHOWPLAN_TEXT. This can be done via the connection URL to the database, by adding the following property to the connection.

__fusionreactor_explainTemplate={0}

Of course this will tell FusionReactor to run the explain again, and as you are already doing that it is unnecessary. So it might be better to turning off the query plan completely for the MSSQL connection when you are running explains. This can also be done via the connection URL by adding the following property to the connection.

__fusionreactor_explainEnabled=false

In either case this property will only affect the connection with the property and FusionReactor will continue to run QueryPlans on other connections if appropriate.

Issue Details

Type: Technote
Issue Number: FRS-378
Components: JDBC
Environment:
Resolution: Fixed
Last Updated: 03/Dec/15 8:50 AM
Affects Version:
Fixed Version: 6.0.2
Server:
Platform:
Related Issues:

Comments are closed.