The Foglight Query Insights feature is a tool for database administrators and developers to get a birds-eye view of the most time-consuming and frequently executed queries of an organization. This feature allows users to identify queries that are causing significant performance issues and prioritize them based on their impact.
Query Insights ranks and sorts "Queries" by "Impact," which is calculated based on the percentage of statement workload in comparison to the total instance workload.
Filtering by impact ensures that statements are not ignored because they are run on a less powerful machine or executed fewer times. if they have a significant impact on the database instance they run on - they will be considered.
Filtering is a crucial feature for analyzing data, and Foglight Query Insights allows filtering to be applied to any of the collected metrics and the query text. This feature enables users to narrow down the scope of their analysis and pinpoint specific queries that are causing performance issues.
With Foglight Query Insights users are just one click away from gaining more insights at the query level by using Foglight Performance Investigator (PI). PI provides a comprehensive view of query performance by offering additional metrics such as query response time, CPU utilization, disk activity, and more. With PI, users can identify specific areas where query performance can be improved.
To start using it, look for “Query Insights” under “Databases” on the left navigation panel in Foglight
It includes the relevant topology and the new Angular dashboard.
In addition, each supported database cartridge is responsible to collect the data and upload it to the Query Insight topology.
This is done by an internal rule defined at the cartridge level that is scheduled to run every 15 min (non-configurable).
For collecting statements, the rule will look for the statements collected during the last 15 min and report the top n (default 10. configurable) that have the highest impact.
The impact is calculated a bit differently for each cartridge, but in general, it is the sum of resources of the statements divided by the total number of resources of the instance for that specific time. The usual measure for the amount of resources is the active_time metric of the statement or elapsed_time.
With Query Insight you can review statements over time by setting the timeframe selector.
Data is saved in the Profiler topology and is aggregated based on the following retention:
The Query Insight dashboard can show up to 250 statements at once, but you can use filters to show more of what you want to focus on. Filters are server-side. each time you apply a filter, it will query the topology again.
Query Insights is supported for the following database cartridges:
Foglight version supported is 6.3 and above.
Queries are reported on database instances that are being monitored in Foglight.
For SQL Server and Oracle there also needs to be a minimum workload associated with the database instance. minimum workload is defined as avg of 1.5 sec/s activity in a 15min timeframe which means at least 1-2 statement is actively running throughout the entire 15 min.
This number can be configured using the appropriate registry variables
Messages similar to the following may appear in the FMS log when SQL Server or Oracle instances are in a minimal workload state
VERBOSE [TimeDriven_Worker-3] Oracle Push Top SQL PI HOSTNAME-INSTANCE - Instance [HOSTNAME-INSTANCE] is in Minimal Workload state
Users can reduce the minimal work load threshold by reducing the the value of Dbwc_Common_Oracle_MinimalWorkloadHighActivityThreshold or Dbwc_Common_SQL_Server_MinimalWorkloadHighActivityThreshold registry variable from the default of 1.5 to 0.1
Filter relation is “and”
Can be used to focus on specific statements by setting filters to the respective metrics (Impact, Elapsed time, Response time, or Executions), Domain, or part of the statement text.
Select all filters you need and then press Apply to get the filtered statements.
Set the relevant registry variable as listed here:
Domain Name | N # Top Registry variable (default 10) |
---|---|
SQL Server | DBSS-TopSQLProfilerExcludedInstance |
SQL Server PI | DBSS-TopSQLProfilerExcludedInstance |
Oracle | DBO-TopSQLProfilerExcludedInstance |
Oracle PI | DBO-TopSQLProfilerExcludedInstance |
SQL Azure | SQL_AZURE-TopSQLProfilerExcludedDatabase |
SQL Azure + PI | SQL_AZURE-TopSQLProfilerExcludedDatabase |
Sybase (MDA) | MDATopSQLProfilerExcludedInstance |
DB2 | DB2-TopSQLProfilerExcludedInstance |
MySQL | MySQL-TopSQLProfilerExcludedInstance |
MySQL-PI | MySQL_PI_TopSQLProfilerExcludedInstance |
PostgreSQLDB2 | PostgreSQL-TopSQLProfilerExcludedInstance |
MongoDB | MongoDB-TopSQLProfilerExcludedInstance |
Redshift | Redshift-TopSQLProfilerExcludedInstance |
Set the relevant registry variable as listed here:
Domain Name | N # Top Registry variable (default 10) |
---|---|
SQL Server | DBSS-TopSQLProfilerMaxTop |
SQL Server PI | DBSS-TopSQLProfilerMaxTop |
Oracle | DBO-TopSQLProfilerMaxTop |
Oracle PI | DBO-TopSQLProfilerMaxTop |
SQL Azure | SQL_AZURE-TopSQLProfilerMaxTop |
SQL Azure + PI | SQL_AZURE-TopSQLProfilerMaxTop |
Sybase (MDA) | MDATopSQLProfilerMaxTop |
DB2 | DB2-TopSQLProfilerMaxTop |
MySQL | MySQL-TopSQLProfilerMaxTop |
MySQL-PI | MySQL_PI_TopSQLProfilerMaxTop |
PostgreSQLDB2 | PostgreSQL-TopSQLProfilerMaxTop |
MongoDB | MongoDB-TopSQLProfilerMaxTop |
Redshift | Redshift-TopSQLProfilerMaxTop |
Updating the value of any of these will affect all agents of that domain. It can be set to a specific database instance (agent) by setting an appropriate scope.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center