ProfilerSqlQueries

Revision as of 14:25, 5 September 2016 by Jis (Talk | contribs)

Profiling SQL Queries

This page describes the SQL Queries profiling mode.

File:Profiler_sql_queries.png

The SQL Queries profiling mode tracks SQL queries executed using the JDBC API, execution times, invocation counts and call trees, enabling to analyze the traffic between a Java process and database instance. Use this profiling mode to realize what queries are being executed and identify performance bottlenecks or bad design patterns like not using prepared statements. See First Profiling Session for details on starting a profiling session.

SQL Queries Profiling Modes

Profiling modes

Two modes are available for profiling SQL queries. The modes and settings can be changed in the Settings pane which is displayed by pressing the Settings switch in Profiler window toolbar.

  • All queries collects all executed SQL queries. This mode is selected by default and doesn't require any additional configuration.
  • Defined queries collects executed SQL queries containing the provided case-insensitive substring.

Toolbar Buttons

  • Pause live results allows to stop updating live results. Pressed automatically when a context menu is displayed for the profiling results.
  • Update live results is enabled when the Pause live results is pressed, allows to manually update paused live results.
  • Show delta/absolute values controls switching between absolute and incremental values.
  • Take snapshot saves the currently available profiling data to a file which can be reopened later for offline analysis or compared with another snapshot.
  • Reset results clears the currently available profiling data, enabling to start collecting new data from a defined point.
  • Take thread dump action takes snapshot of all threads in the profiled JVM including their call stacks and displays it in a separate view. See the Thread Dump chapter for details.
  • Take heap dump action saves a snapshot of all objects currently stored in the heap memory in a .hprof format and optionally opens it in a heap viewer. See the Heap Dump chapter for details.
  • Request garbage collection action requests garbage collection in the profiled JVM. There's no guarantee when or if at all the garbage collection will be performed. To make sure GC will be run, the action should be invoked several times.

SQL Queries View

The results view displays executed SQL queries, execution times, invocation counts and call trees, SQL command types, referenced database tables and SQL statement types. The view provides the following data columns:

  • SQL Query column shows text of the SQL query and its invocation call tree.
  • Total Time column shows time spent in all invocations of the SQL query.
  • Invocations column shows number of invocations of the SQL query.
  • Command Type column shows command type of the SQL query (SELECT, INSERT, ALTER etc.).
  • Tables column shows list of database tables referenced by the SQL query.
  • Statement Type column shows the SQL statement type (regular, prepared, callable).

Tip: The columns can be displayed or hidden using the right corner button in the view header by clicking the dropdown arrow (or right clicking the header on Mac OS X). The relative value bar can be displayed or hidden for every column which displays a relative value by resizing the column.


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo