SingleStore DB

1. Identifying Expensive Queries

  1. In SingleStore Studio, navigate to the Activity Resource Usage page.

  2. If you don’t have monitoring data from SingleStore’s monitoring solution, press Begin Profiling to capture current cluster activity for a period of time. Be sure to record during the workload or query of interest, if you have identified one from collecting a report in the previous step, or from another source.

  3. If you do have monitoring data, toggle the time selector to the applicable time range for any query or workload of interest. By default, the last hour is shown.

  4. If one has been identified, switch the database selector to the problematic database. See the following example image, where you can find the database selector to the top left.

  5. Sort on Elapsed Time and Run Count by clicking on the field name. Hover over the Time Spent bar and look at what queries are spending the most time on.

  6. Sort on CPU, Memory, and Network, respectively to identify other resource-intensive queries.

  7. Distinguish query shapes that may be resource-intensive due to having a high run count compared to others. Is a query using resources because of how many times it has been executed, or is it using a large number of resources across a low number of executions?

  8. Note the activity_name of queries that have high elapsed time, run count, and/or that are using a lot of a given resource.

  9. Click on the Nodes tab to identify which node these queries are running on. The Nodes tab can also help to confirm why a given node is running slowly.

Next Steps
  • If you found a query of interest that is long-running, utilizing a lot of resources, or has an unusual run count, move onto Step 2.

  • If you didn’t identify any useful information here: move onto Step 3.