SAP HANA -A Statement is Sometimes Slow and Sometimes Fast

There are a number of things to check when you experience inconsistent query execution time.
Check the following possibilities:

Root Cause: If a related table was unloaded, it takes some time to load tables

Required Action: Check unload trace and execute after table loaded fully. You can refer to LOADED column of M_CS_TABLES.


Root Cause: Query compilation time is long.

Required Action: Check the execution time after adding ‘with hint (ignore_plan_cache)’ at the end of query. This hint will always cause the query to be compiled. If a long running compiled query plan has been evicted frequently from the plan cache, increase the query cache size. For more information, see SQL Plan Cache Analysis.


Root Cause: merge status of column table can affect query plan

Required Action: Check MEMORY_SIZE_IN_DELTA, RAW_RECORD_COUNT_IN_DELTA, and LAST_MERGE_TIME columns of M_CS_TABLES whether there is large amount of data in delta Check M_DELTA_MERGE_STATISTICS to check when the last merge occurs. For more information, see Delta Merge

Leave a Reply