Samples
SolarWinds Observability captures raw samples of the queries that are sent to your monitored MySQL, MongoDB, PostgreSQL, or SQL Server database in addition to aggregate query metrics. This provides richer detail into query activity, especially slow queries or queries which generate errors, and also lets you examine execution plans for opportunities for optimization. The Samples page allows you to answer questions such as:
-
What queries did this user run which took longer than 2 seconds?
-
What slow queries use this database?
-
What queries did this client run?
To access the Samples tab, Click Databases > Samples. The Samples tab from the Databases Overview displays all available samples across your monitored databases for the selected time period.
You can also open the Samples tab from the Queries Explorer. On the Query Details Overview page, click Samples to open the Samples page for the selected query. The Samples page displays captured query samples for the selected query and details about the query execution.
The following details are available:
Metric | Description |
---|---|
Sample Text | Displays a recorded query sample of the selected query. |
Sample Insights | Displays a colored dot indicating whether a sample has explain plans (blue), warnings (yellow), or errors (red). |
Database | Displays the database that the query was executed against. |
User | Displays the user(s) that executed the query. |
Origin | Displays the IP address and port of the client that issued the query. |
Timestamp | Displays the day and time when the query sample was created. |
Latency | Displays the average latency for the query sample in milliseconds. |
Connection ID | Displays the unique connection identifier. |
Trace ID | The trace id associated with the query sample. Click the TraceId link to open the Traces Explorer for your selection. See Trace context in queries for more information. |
The Samples by Latency chart, and the Samples grid display recorded query samples for the last hour by default. Query samples are color-coded to help you to quickly identify samples that have errors, warnings, or explain plans. The Samples by Latency chart also displays the average latency and p99 latency for the recorded query samples.
Filter for specific sample text, database, user, origin, minimum latency, maximum latency, connection ID, or a combination of options using the search bar. Click Clear All to clear the filter and return to the collected default samples.
Click the Sync with table pagination toggle to sync the results of the chart with the All Samples table below.
Filter the Samples by latency chart by the Top 250, or Top 500 queries to identify big picture patterns for your recorded query samples, allowing you to optimize your database's performance. Further adjust the query samples by samples with errors, or samples with warnings to identify problematic queries that require more attention. Click Reset to return the Samples by Latency chart to its default state.
View sample details
Click a bubble in the chart, or a sample from the table to display the Sample Details Overview for your selection. Query sample details are displayed on the Sample Details Overview tab, with full query sample text and syntax highlighting. Click View Details to open the Queries Explorer for the selected query sample.
Click Explain Plan to display the Sample Explain Plan for your selection. The RAW Explain Plan is displayed by default with syntax highlighting. Click Copy to Clipboard to copy the Explain Plan.
Click Table View to display the sample Explain Plan in an easy to read detailed format. The Explain Plan Table will display different metrics based on the selected query sample.
Click Overview to return to the Overview.
Share samples with stakeholders
Share problematic or concerning samples with stakeholders quickly and easily on the Sample Details pane. Click the desired sample to open Sample Details, and then click Share Sample. Click the clipboard button to copy the link, and share it with the desired stakeholders.
Visualize costly query operations with the Visual Explain Plan
Quickly discover any costly node or operation in your samples with the Visual Explain Plan. Open any Sample Details pane for a sample that contains an Explain Plan. Click Visual Explain Plan on the Explain Plan tab to display the Visual Explain Plan. The visually represented Explain Plan should be read right to left, with nodes displaying beginning query operations all the way through to the query's completed execution. Each node has a numbered cost and percentage displaying its individual operation cost within the query. Nodes are color coded as follows.
Color | Meaning |
---|---|
Red | Query node/operation costs greater than 50 percent of total query operation. |
Yellow | Query node/operation costs between 10 and 50 percent of total query operation. |
Green | Query node/operation costs below 10 percent of total query operation. |
Red nodes represent the mostly costly parts of your query, and let you see which areas in the query could use optimization. Click a node to display detailed metrics about the query operation such as the logical operation name, estimated cpu cost, estimated rows affected, estimated I/O, and estimated execution mode. Adjust the Visual Explain Plan view with the zoom bar and directional buttons.
Click the Plan Meta data button to display Explain Plan details such as the Build number, statement cost, statement rows, whether the plan was retrieved from the cache, and the statement type.
Click X to return to the Sample Details Explain Plan tab.