cancel
Showing results for 
Search instead for 
Did you mean: 

_SYS_STATISTICS.HOST_LONG_RUNNING_STATEMENTS

former_member774514
Discoverer
0 Kudos

So we are seeing some log running statement alerts from Hana. It is from our Matillion extract tool.

When I chase down the offending query - Its: "select * from SAPABAP1.MATDOC" (200million rows)

via query: select * from _SYS_STATISTICS.HOST_LONG_RUNNING_STATEMENTS where thread_id = 31739;

The HANA alert had the thread_id in the email that I used in the SQL.

But just looking to see how many times this statement ran in past and was logged in "_SYS_STATISTICS.HOST_LONG_RUNNING_STATEMENTS"

I can see it running 9 times in last 10-12 mins.

Each has different/unique thread_id's but same statement_hash. Snapshot_id and server_timestamp is every 1-3 mins.

When I query the plan_cache I only see the statement once: Select * from M_SQL_PLAN_CACHE where application_name = 'Matillion';

is the view _SYS_STATISTICS.HOST_LONG_RUNNING_STATEMENTS deceiving me? i.e. is HANA smart enough to automatically parallelize the large select query into say 9 different threads to return the 1 result? Or can I believe the "_SYS_STATISTICS.HOST_LONG_RUNNING_STATEMENTS" which is kind of telling me it ran 9 times in last 10 or so minutes. Which is nuts.... as each select is returning 200million rows.

Accepted Solutions (0)

Answers (1)

Answers (1)

eason_chen
Advisor
Advisor
0 Kudos

Hi Jeff,

In case you would like to analyze the SQL further, I would suggest you run following SQL script attached in note 1969700. It would provide you better readable information.

HANA_SQL_StatementHash_DataCollector
PS: You need replace STATEMENT_HASH, with your own one in /* Modification section */
e.g.
'3394a281474b6d21efe7e8efc3a0738c' STATEMENT_HASH,
===>
'618....6a9' STATEMENT_HASH,

Best Regards,
Eason Chen