Optimize your SQL Queries

DBA tools can identify slow queries affecting DB response times. But this information is often useless for developers, as they usually cannot locate the origin of such a query in their code. In such cases, poor performing SQLs remain unchanged in the code.

By combining SQL execution statistics with a static analysis of the code, Visual Expert can go further and pinpoint the procedures or functions where the SQL should be improved.

You can review the queries accessing a table to identify performance issues:

  1. Double-click on the root of the tables to list them
  2. Select a table (or several tables while pressing the key [Ctrl])
  3. Click "SQL Statement Execution Time", from the ribbon or the navigation bar
  4. The slowest queries are listed, based on their average execution time.

Display SQL Statement Execution Time with Visual Expert

This feature comes with 2 parameters to let you customize it (click the small wrench on the right to set them):

  • Number of functions displayed in the result (20 by default)
  • Minimum execution time, to view only functions with a significant response time

Customize the results of SQL Statement Execution time results

Once you identified a slow query, you can find the procedure that generated it, and review its source code:

  1. Select the query with a slow response time
  2. Click "Locate" in the navigation bar
  3. The location and source code of the query is displayed.
  4. Select the procedure containing the query to show its code.

Identify Procedures generating slow queries