The Query Explorer in Foglight is a diagnostic tool that enables database administrators and performance analysts to search, filter, and analyze SQL queries executed within monitored database environments.
It gives you insight and control over SQL query performance so you can maintain a fast, efficient, and healthy database environment.
This feature is applicable only for SQL Server PI and PostgreSQL PI.
The Query Explorer enables you to:
To access the Query Explorer dashboard, click Query Explorer on the Welcome page, or navigate to Databases > Query Explorer in the left navigation pane.
This section covers the following key areas:
Query Explorer allows you to search and analyze query performance across SQL Server and PostgreSQL environments. It provides deep insights into query execution, resource consumption, and wait events, enabling you to identify and troubleshoot performance issues efficiently. By filtering queries by domain, instance, text, or resource usage, you can focus on high-impact statements and gain a clear understanding of how queries affect overall system health.
To search a query:
The list is always filtered based on the selected time range. Only queries that match the search criteria and were executed within that time frame are displayed.
Click Reset to clear all inputs.
This pane provides details about the performance and resource usage of a specific SQL statement. In the Statement Details pane, use the Expand and Minimize
controls to adjust the view. Expanding the pane allows you to see more detailed information about the selected query, while minimizing it helps conserve screen space when viewing multiple queries.
Once a query is selected, the Statement Details pane displays:
To view the detailed information about the statement, click the expand icon.
This displays a screen with following details:
Highlights - Summarizes key information about the query’s behavior and suggests possible next steps for further analysis. You can click Investigate, Analyze Plan or Compare to view further details as mentioned in the section above.
Dimensions by Impact - Summarizes statement activity across key dimensions that helps you to identify which dimensions were involved in query execution. It also enables you to compare performance across different items within the same dimension, such as databases, users, or applications. The dimensions involved are -
Resource Breakdown - Provides a visual analysis of how different system resources are being utilized during SQL query execution. It shows how the total execution time is distributed across different resource types (for example, CPU, Memory, I/O, and Waits). This helps identify what kind of resource the query is consuming most. You can also view additional metrics related to statement activity by selecting them from the dropdown lists.
Workload Metrics - Provides a detailed breakdown of how SQL queries are performing over time, focusing on execution and timing metrics. It displays a table for various resource consumption metrics, providing an in-depth view of query activity. Each metric is associated with a specific resource. Use the dropdown list to display metrics related to the resource that had the most impact on query performance, or select All to view all available metrics.
Blocked Sessions - Provides a detailed view of SQL sessions that were blocked during execution. This information is essential for diagnosing performance issues related to locking and blocking in the database. The view displays the top X blocking events that occurred within the selected time range, ordered by lock duration in descending order.
You can open the Query Explorer page in Foglight directly from another monitoring application using a formatted URL:
<Base URL>?<Search Details>
where:
By adding the above mentioned details, a URL can be created to access Query Explorer. For example:
https://<your-environment-host> /aui/foglight-sql-profiler/query-explorer-direct-link?hostName=10.250.29.14&startTime=1750729861000&endTime=1750744261000&domain=SQL Server&filters=Databases,sales,@Users,FOGLIGHTclusteradmin@Programs,SQLAgent-JobManager,master&queryText=SELECT t.relid as relid
If there is an error in any of the parameters mentioned above, then an error message appears on the screen.
After entering a valid URL, log in to Foglight if prompted. After authentication, the Query Explorer page opens with the specified SQL text preloaded (if found). Use filters within Query Explorer to refine the query context as needed.