SQL query to check running statements/procedures in HANA memory and their memory consumption
Here’s a handy SQL that I often use to check what statements or procedures are currently running in HANA memory and how much memory each of them is consuming and how long they have been running ordered by the highest consuming first.
c.host, c.user_name, c.connection_status, c.transaction_id, s.last_executed_time,
round(s.allocated_memory_size/1024/1024/1024,2) as "Alloc Mem (GB)",
round(s.used_memory_size/1024/1024/1024,2) as "Used Mem (GB)", s.statement_string
m_connections c, m_prepared_statements s
s.connection_id = c.connection_id and c.connection_status != 'IDLE'
Hope this can be helpful to everyone.