16.10.2015 Views

Getting Startedwith pureQuery

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6 – The Client Optimizer: <strong>pureQuery</strong> for Existing Applications 97<br />

5.2.2 Gathering and viewing explain data<br />

You can gain insight into the health of your SQL statements by obtaining information such<br />

as the predicted cost, whether indexes are used, or the number of joins used for<br />

example—Oracle and IBM databases, including IDS, are supported.<br />

To view explain information, right-click on the SQL Outline and select Show DataShow<br />

EXPLAIN Data. If you would like to see this explain information for a specific SQL<br />

statement, right-click on the statement in the SQL Outline and select Retrieve EXPLAIN<br />

Data from the context menu. To retrieve the explain information for all statements within an<br />

application right-click on the Java project and select Properties. On the left-hand-side<br />

expand the <strong>pureQuery</strong> category and select Background EXPLAIN. Then select to Enable<br />

project specific settings and to Enable Background EXPLAIN and click OK. Explain<br />

information will start to be gathered for all of the statements in the SQL Outline belonging<br />

to that specific Java project. Once all the explain data has been gathered, it will<br />

automatically show next to SQL statements if you have chosen to view EXPLAIN Data in<br />

the SQL Outline as shown in Figure 5.5.<br />

Figure 5.5 - View explain information for SQL statements within your application<br />

You can also change the view of the SQL Outline to show in a table format—Figure 5.4—in<br />

order to sort the columns if you are interested in finding the statement with the highest cost,<br />

for example.<br />

5.3 Optimizing your application for performance<br />

Once you have identified which statements take the longest to execute or any other<br />

statement that you believe needs optimizing you can do one or a combination of the<br />

following:<br />

• replace a poorly performing statement with an optimized one using the<br />

<strong>pureQuery</strong>XML Editor

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!