Skip to main content

SQL Statistics

Home > Select Project > Stat/Report > SQL Statistics

Statistics are created based on the SQL execution count, execution time, and waiting time within the active sessions collected by the agent, and a list of top SQLs for the search period is provided. It provides a basis for analyzing frequently performed SQL performance through the average and maximum execution time.

For quick performance analysis, you can search top SQLs for each frequently analyzed category (DB, application, user, host). The main search criteria are as follows:

  • execute count: Execution count of the SQL

  • elapse sum (sec): Total execution time (secs) of the SQL

  • elapse avg (sec): Average execution time (sec) of the SQL. It is the result of elapse sum/execute count.

  • elapse max (sec): Maximum execution time (sec) of the SQL

  • elapse wait (sec): Total waiting time (sec) of the SQL
  • instance: Instance name
Info

SQL Statistics function creates statistics based on the SQL that excludes literal values.

Basic screen guide

SQL Statistics

  1. In number 1 Time, select the time and date to view the data. You can select a lookup time after selecting the green button.

  2. In number 1 Instance, select a target to view the data.

  3. Select Search icon.

The top 50 entries appear in the table.

Note
  • Select the clock display area to query a random date and time. If you click the date and time text area, the selectable options for the date and time appear.

  • If you select each column in the table header, you can sort the list by the selected item.

  • You can sort the searched results by the item selected in Sort by. Select a desired item and then select .

  • In View count, you can set the number of entries to display in the table. Finish the settings and then select .

  • To download the viewed data as a CSV file, select Download icon.

Checking the query-based execution trend

To classify and view data by usage category, select the desired tab from number2.

On the utmost left for each item of the table, select number3 ►. A chart appears that displays the number of executions every 5 minutes and the average execution time of the query statement. If you hover your mouse over each bar graph, you can see the number of that time.

Note

If you select a bar graph for the desired time in the graph chart, the Monitoring a Database Instance menu appears. You can see the metrics for the selected time. For more information about Monitoring a Database Instance, see the following.

Previewing the query

Query preview

You can preview the query statement by moving the mouse pointer to the sql column in the search results list.

See query details

If you select query column from the searched result list, the SQL details window appears.

SQL details

  • View SQL Statistics: You can go to the SQL statistics menu where you can check statistical information related to the SQL query statement.
  • Default Bind: You can bind the part set as a variable in the query sentence to the default value.

  • Reset Bind: You can release the bound default value and check the variable.

  • Formatting: You can improve readability by applying indentation and formatting to a SQL query statement.

  • Plan: To check plan information, enter DB Name, User Name, and Password, and then select Search icon.

    • Text: You can check plan information in text format.

    • JSON: By viewing the plan information in Json format, you can quickly find the points where bottlenecks occur.

    Note

    The function to view plan information in JSON format is supported only in DBX agent 1.6.12 or later.

Tip

If you select a table or index while viewing the plan information in JSON format, the Object detail window appears where you can see the configurations for columns and index items in the table.

Object detail

This function is supported in DBX agent 1.6.15 or later. For more information about the database roles and related settings, see the following.

Checking the information details

Session Detail

When the bar graph is selected in the chart, the Session detail window appears where you can check statistical data for 5 minutes. The list of SQL executions appears for the selected time. When an item is selected, it goes to the Instance monitoring menu with a new window.

In Instance monitoring, you can check active sessions in the table and trends of various metrics in the selected time zone.

Filtering the searched results

Adding the filter conditions

You can filter the results by SQL text, agent name, or DB user name.

  1. In the Filter option, select .

    Adding contion

  2. In Filter key, select a desired filtering criteria.

    • If the value of the selected item is text, you can select any of Includes (blue) and Excludes (red).

      example

    • If the value of the selected item is number, you can select any condition of == (equal to), >= (greater than or equal to), and <= (less than or equal to).

  3. In Condition, select a condition.

  4. Enter a string or number to match the condition.

  5. Select Apply.

Note
  • To add filtering conditions, select Add and then repeat Step 1 to 5. Added conditions are applied based on AND (&&).

  • To delete some items while adding conditions, select Delete icon on the right of the filter conditions. To delete all conditions, select Delete icon Delete All.

  • To quickly delete the conditions applied to the Filter option, select .

  • The default setting is to exclude if sqlText contains 'WhaTap'.

    WhaTap

Modifying the filter conditions

Edit filter

Click any applied to the Filter option. If the Edit filter window appears, modify any desired items and then select Apply.

Setting the table columns

You can hide the table header columns or add any of them. You can also change the column order. Select Column icon.

Column Settings

Note
  • After configuration, select Confirm to apply the settings in the table.

  • In the number 3 search bar, enter text to search the desired columns. Only the columns that meet the entered text are displayed.

  • Images may differ depending on the product, project, or menu.

Adding columns

From the Number 1 list, select the items to add as table header columns. To select all items, select Select All.

Deleting columns

From the number 1 list, unselect the columns to delete. Alternatively, select Delete icon on the right of the item to delete from the number 2 list.

Changing the column order

Drag an item to reposition from the number 2 list, and then move it to the desired position.

Initializing the configuration

To cancel all changes and reset them, select Reset icon Initialized.