All queries
The Queries → All queries page displays all queries executed in an ADQM cluster during the specified time interval (including queries executed on each cluster host to process distributed queries — such queries are prefixed with /* ddl_entry=query-num */ before their main text).
Fields of the "All queries" table
The Queries → All queries page provides information about queries as a table, which may include the following fields.
| Field | Description |
|---|---|
Query ID |
Unique query identifier. The column also shows an icon indicating the query status:
Query status can also be separately displayed in the Status column that allows filtering |
Query text |
Query text. For a long query, its text is truncated and when you hover the mouse cursor over the column cell, it is displayed as |
Status |
Current status of a query. Possible values:
|
Host |
Host where a query was run |
Exception |
Text of an error occurred before or during a query execution |
Exception code |
Code of an error occurred before or during a query execution |
Frequency |
How many times a query was executed in the cluster during the selected time period in the context of all filters currently applied on the page. Statistics are calculated for queries whose text completely matches (i.e. for parameterized queries, specific parameter values are taken into account) |
Databases |
Names of databases accessed by a query (there may be multiple — for example, if a query uses JOIN) |
Tables |
Names of tables accessed by a query (there may be multiple — for example, if a query uses JOIN) |
Used memory |
Amount of memory consumed by a query |
User |
Name of an ADQM user who initiated a query execution. For queries executed on cluster hosts when running a distributed query, a user is not defined — the User column shows an empty string ( |
Time started |
Query execution start time |
Duration |
Duration of a query execution or the current execution time ( |
Average duration |
Average query execution time. Statistics are calculated for queries whose text completely matches (i.e. for parameterized queries, specific parameter values are taken into account) |
Read bytes |
Total amount of data read from all tables and table functions participated in a query. For distributed queries, this is the number of bytes read on all replicas — each replica sends its |
Result bytes |
Amount of memory to store a query result |
Result rows |
Number of rows in the result of a |
Read rows |
Total number of rows read from all tables and table functions participated in a query. For distributed queries, this is the total number of rows read on all replicas — each replica sends its |
Written rows |
Number of rows written by an |
Written bytes |
Amount of data written by an |
Type |
Query type. Possible values:
|
To display/hide fields of the All queries table, click Customize table and select the desired fields in the drop-down list. The Query ID and Query text fields are always visible, they cannot be hidden.
Sort and filter data
In the column headers of the table on the Queries → All queries page, there are filters that you can use to select specific data. To open a filter, click the icon
. Filters are available in the following columns:
-
Query text — enter a truncated query text (as it is displayed in a tooltip that appears when you hover the mouse cursor over a column cell) or its fragment;
-
Databases, Tables — enter a name of a database or table (for rows with multiple databases or tables separated by commas in the Databases or Tables column, filtering works only if the search is performed by one item from a list of databases or tables in a cell);
-
Exception code — enter a numerical error code (or multiple comma-separated codes) on the Search tab or select a group of errors on the Presets tab;
-
Host, User — you can enter names of multiple hosts or users, respectively (for queries initiated by a distributed query, filtering by an empty value in the User column is not supported);
-
Duration — you can enter the minimum and maximum query execution time (in seconds);
-
Status, Type — you can select a value (query status or type) from the drop-down list.
The icon
indicates that a filter by column values is applied. To reset all filter conditions, click
.
Data sorting is available in the following columns: Exception (actually sorting is performed by error code), Exception code, Used memory, Time started, Duration, Read bytes, Result bytes, Result rows, Read rows, Written rows, and Written bytes. To change a sort order by column values, use the icon
or
in the column header.
Above the table with queries, there is a panel that shows the sorting (Sorted by) and filtering (Filtered by) conditions currently applied to data.
Query details
To view detailed information on a query, click its identifier in the Query ID field of the All queries table.
The Query details page that opens contains the full text of the selected query, as well as the description of an error if it has occurred during the query processing. The page also displays query metrics in the columns selected on the All queries page via Customize table.
Graphs
On the Queries → All queries page, you can build graphs to analyze queries sent to your ADQM cluster tables during a specified period of time, based on the following metrics:
-
Duration — query execution time. Two types of graphs are available:
-
Duration trend — trend in query execution duration;
-
Duration delta — comparison of the average query execution duration in individual time cells of a selected time interval relative to the average query execution duration across that entire interval.
-
-
User — distribution of queries by users. Two types of graphs are available:
-
User queries — number of queries sent by particular users;
-
User load — load on a cluster created by queries from particular users, due to which queries from other users must wait in a queue for execution.
-
-
Kind — number of queries of certain types.
-
Host — distribution of queries across cluster hosts (with detecting possible anomalies by various metrics of host load during query execution).
To build a graph, click Show graph and select the desired graph type from the drop-down list.
In the drop-down menu to the right of the graph, you can change the graph type, as well as choose the level of detail (number of points on the graph): Low or High.
Duration
When selecting the Duration graph type, use the Trend/Delta switch in the panel on the right to build the Duration trend or Duration delta graph, respectively.
For the graph, you can select the scale type: Normal or Log (the logarithmic scale can be more convenient for larger time intervals — for example, a month or a week).
Duration trend
The Duration trend graph shows the overall trend of query execution duration allowing you to find queries that have taken a long time to complete (relative to other queries in the same time interval) and need to be analyzed.
This graph displays the following information on the execution time of queries sent to an ADQM cluster during a specified period of time:
-
95th Quantile — 95th quantile of query execution time.
-
Average — average query execution time.
-
Extreme zone (area shaded in red if the Average line is above the 95th Quantile line) — time interval when there was one or more long queries relative to most others. For example, in the graph above, such a zone is observed in the time range from
6:00to7:00— in the queries table, you can see that at06:58:07there was a query with a duration of1m 17s, while all other queries were completed much faster (the queries in the table are sorted by the Duration column in descending order).
Calm zone (area between the Average and 95th Quantile lines, shaded in green) — time interval when duration of all queries was comparable. A peak in this zone means that all queries in a given time interval have become longer to complete. -
Query — number of queries.
-
No data (area shaded in gray) — time interval for which there is no data about queries according to the applied filters. The No data item appears in the legend only if the graph contains one or more time intervals with missing query information.
Example of a graph with no data on queries
Graph including "No data" time intervals
Duration delta
The Duration delta graph visualizes the difference (delta) between the average query execution time in each cell of the time interval selected in ADQM Control and the average query execution time over this entire interval. The green and red bars on the graph indicate faster and slower queries in cells, respectively, relative to queries across the total interval. A value of the difference in average query execution time is shown in a tooltip when the mouse cursor hovers over a cell’s bar (the Window diff value, in milliseconds and percentage).
When you click a bar corresponding to a specific time cell, this cell is marked as selected, and detailed information is displayed in additional panels below the graph to compare the average execution time of queries in this cell and queries in the rest of the time interval. You can also select multiple consecutive time cells for analysis by clicking the corresponding bars on the graph in sequence.
Panels that are shown when you select time cells on the graph:
-
Cell (N cells, if multiple consecutive cells are selected) and Rest of window — information on queries executed during the time interval of the selected cell (or multiple selected cells) and during the rest of the time, respectively:
-
Queries — number of executed queries;
-
Average — average query execution time;
-
p95 — 95th quantile of query execution time;
-
Slowest 5% mean — average execution time of the slowest 5% of queries.
-
-
Delta — values indicating the difference in query execution duration between the selected time cell and the rest of the interval (that is, a comparison of values displayed in the Cell/N cells and Rest of window panels).
-
Workload — user names (maximum 3), sorted in descending order by the total execution time of their queries within the selected time cell. For each user in the list and for all other users (Others), the number of sent queries and their average execution time are displayed.
-
Profile — graphs that can be useful for a more detailed analysis of the factors behind the difference in average query execution time between the selected time cell and the rest of the interval. Two types of graphs are available:
-
Cost — profile of the "cost" of queries by execution time, showing how much time per query could be "saved" if all queries that were executed for longer than a certain duration (the value on the horizontal axis) would be executed for exactly that amount of time.
-
Count — percentage of queries executed in the selected time cell and queries executed in the rest of the interval that took longer than a specific duration (the value on the horizontal axis).
-
User
When selecting the User graph type, use the Queries/Load switch in the panel on the right to build the User queries or User load graph, respectively.
User queries
The User queries graph allows you to see the number of queries sent to the cluster by each user and evaluate this number relative to the number of queries from other users and to the total of all queries. The graph is built using data on queries from users whose names are listed in the filter by the User column. You can also specify user names in the field to the right of the graph (the list of selected users is automatically synchronized with the filter by the User column).
User load
The User load graph allows you to compare the average load on a cluster generated by queries from different users over a specific time interval. With this information, you can identify users whose queries have the most significant impact on the execution of other queries, causing them to wait in the queue. To select users for visualization on the graph, use the User column filter or the field to the right of the graph (the lists of users selected in these filters are automatically synchronized).
The load metric, which is used to build a graph, is a dimensionless value (it can be greater than 1) indicating how many queries are waiting in the queue for execution due to concurrent queries from this user. For example, in the legend on the graph below, you can see that, on average, in the selected time interval, 0.83 queries were waiting in the queue for execution due to the load created by queries from the dist_user user; 0.39 queries were in the queue — due to queries from the default user; and 0.18 queries — because of the combined load created by queries from all other users. At the same time, the dist_user user sent significantly fewer queries to the cluster (30.76k) than the default user (2.72m) and than all other users in total (2.22m). Based on this data, it can be concluded that queries sent by the dist_user user may be unoptimized or resource-intensive, which affects other queries.
Kind
On the Kind graph, you can see how many queries of different types were executed — select the required query types using the drop-down list to the right of the graph.
The graph is built according to the filters set in the table of queries. For example, the graph above shows the number of queries performed by the user_29 user for the selected time period.
Host
Using the Host graph, you can analyze the load on ADQM cluster hosts and find potential anomalies in their work on executing database queries. In this context, an anomaly is a deviation in the value of a metric at a certain point in time compared to its values within the host’s operation over a selected time period or compared to the values of this metric at the same time on other hosts. Values of the metric being analyzed are shown as the width of the graph line. Anomalies are highlighted in red (if the corresponding option is enabled in the graph settings — see the description of the settings below). The color gradient of the graph line from green to yellow indicates the "level of confidence" in the presence of an anomaly.
The graph is built for the hosts selected in the Host column filter. You can also manage the list of selected hosts in the panel to the right of the graph. Up to 8 hosts can be added to the graph simultaneously. If there are more than 8 hosts in a cluster and they are not filtered, the graph will be built for the first 8 hosts in alphabetical order. If you need to display other hosts on the graph, remove some selected hosts from the list to add the necessary ones instead.
The Settings menu to the right of the graph (click it to expand) contains the following settings:
-
Metric — metric on which the graph is based. You can select one of the metrics:
-
QPS — number of queries executed per second;
-
RPS — number of data rows processed per second (when performing read and write operations);
-
Avg Duration — average query execution time;
-
Throughput — amount of data processed per second (when performing read and write operations);
-
P95 Duration — 95th percentile of query execution time.
-
-
Sensitivity — level of sensitivity to deviations in metric values when detecting anomalies (for example, Aggressive — even a minor deviation in the metric value is considered an anomaly; Low — only a large deviation in the metric value is considered an anomaly). For each sensitivity level, the evaluation of metric values and the detection of anomalies are performed separately (independently of the calculations made for the previously selected sensitivity level).
-
Mode — metric value evaluation mode. Available options:
-
Per host — host metric values are compared over a selected time interval (a metric value is considered normal if it is within the range that is "normal" for the host within the selected time interval);
-
Cluster — host metric values are compared with the values of the same metric on the other hosts;
-
Auto — set of values of all metrics is evaluated.
-
-
Anomalies — the Show switch turns on/off highlighting anomalies in red on the graph.
-
Display — metrics to be displayed in a tooltip that appears when you hover over the graph. The metric on which the graph is based is shown in the tooltip anyway — its visibility cannot be controlled via Display. In the Auto mode, the tooltip displays all metrics.