Important
Self-managed SingleStore will soon transition from version 9.1 RC to version 10. This new semantic versioning scheme will provide SingleStore with finer control over engine and feature releases that were not possible with the current versioning scheme.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10 prior to its general availability. Ahead of this transition, SingleStore 9.0 is recommended for production workloads, which can later be upgraded to SingleStore 10.
Use Case: Memory Usage by a Query
How to find the total typical memory usage of a recent run of a query?
Use the following query to get the total typical memory usage of a recent run of a query for all activities on the aggregator and on all partitions of the leaf nodes:
SELECTaggregator_activity_name,SUM(memory_bs * 1000) / (SUM((CASE WHEN mvae.activity_name = aggregator_activity_name THEN elapsed_time_ms ELSE 0 END))) AS avg_clusterwide_mem_bytes_per_second,ANY_VALUE(query_text)FROM information_schema.mv_activities_extended mvaeINNER JOIN information_schema.mv_queries mvq ON mvae.aggregator_activity_name = mvq.activity_nameGROUP BY 1ORDER BY 2 DESC;
This gives us the cluster-wide memory usage of all instances of user queries, divided by the sum of query latency of those instances.LIMIT 5 clause at the end.
Note
The MV_ table provides data only as far back as the uptime, as it is cleared out when the aggregator node restarts.
Warning
The measurement AVG_ is the total memory usage, averaged over the execution time of the query.
Last modified: