14. Profiler

Profiler allows you to measure the performance and execution cost of SQL and PSQL code.

_images/profiler.png

Fig. 14.1 Profiler

  1. Select the connection of interest from the drop-down list.

  2. Click the Select button and in the window that opens, select the user connection to be profiled:

    _images/profiler_user.png

    Fig. 14.2 Selecting a user connection to profile

You can also open a saved profiler session by clicking the Load button:

_images/profiler_add.png

Fig. 14.3 Saved Sessions

Formats for displaying the result:

  • Compact view - Displays an overall view of query execution. Repeating processes within a common parent will be merged into one. This is the default value.

  • Display access data - Displays/hides the plan for executing the request. Enabled by default.

  • Round values - If the total or average time is greater than 1000000ns, it will be converted to a larger unit until the value is less than 1000000ns. Enabled by default.

Cancel All Sessions button cancels all profiling sessions for the selected connection (with the specified ATTACHMENT_ID).

In compact view, for each non-last node (except for ROOT NODE - the root node) there is a node Total time, which shows the time spent without taking into account child processes.

In result table displays information collected by the profiler, viz:

  • Process name or SQL code;

  • Time per process in nanoseconds (including child processes) and the percentage of time from the parent process;

  • Average time per process in nanoseconds (including child processes) for repetitive processes combined into one node;

  • Number of calls of the recurring processes.

При двойном клике по узлу откроется окно просмотра данных:

_images/profiler_data.png

Fig. 14.4 Data view

A Profiler session can be run for a single query from the Query Editor by clicking the Run in Profiler button. In this case the following will be executed:

  1. Starts profiler session.

  2. Query in the editor will be executed.

  3. Profiler session will finish.

  4. Displays profiler panel with the collected information.