본문 바로가기

Database

[HANA] Cache Memory

Important SAP HANA caches

Cache

Allocator

Name in cache framework

SAP Note

Purpose

Analysis command

Configuration parameters

Adapter operations cache

Pool/AdapterOperationCache

AdapterOperationsCache

 

 Cache for SDQ operations

SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

 

Calculation engine node cache

Pool/itab

CalcEngineNodeCache

 

Cache for cache node itabs related to planning engine

SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

 

Calculation engine model cache

Pool/CacheMgr/CE_ScenarioModelCache

CE_ScenarioModelCache (SAP HANA >= 2.0 SPS 03)

 

Cache for  calculation engine models

SQL: "HANA_CalculationEngine_CalculationScenarios"

indexserver.ini -> [calcengine] -> max_cache_size_kb

Column store statistics cache

Pool/CacheMgr/CS_StatisticsCache

CS_StatisticsCache

2124112

Scale-out cache for column store table statistics used by optimizer

 SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

indexserver.ini -> [cache] -> cs_statisticscache_enabled

Currency conversion cache

Pool/TREXCache/CacheMgr/Currency/UnitConversion_RateQueriesResultCache

Currency/UnitConversion_RateQueriesResultCache

1999997

Cache for currency conversion rates

SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

indexserver.ini -> [businessdb] -> cache
indexserver.ini -> [businessdb] -> cache_erp_currency_query_base_rates
indexserver.ini -> [businessdb] -> cache_erp_currency_query_rates

Data statistics adviser cache

Pool/CacheMgr/DataStatisticsAdviserCache

DataStatisticsAdviserCache

 

Cache for CREATE STATISTICS advisory

SQL: "HANA_Memory_Caches_Overview"
SQL: "HANA_Memory_Caches_Entries"
 

Hierarchy cache

Pool/hierarchyBlob

HierarchyCache
HierarchyItabCache

1999997

Cache for hierarchical queries

SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

indexserver.ini -> [cache] -> hierarchies_transactional_cache_enabled 

MDX hierarchy cache

Pool/hierarchyBlob
Pool/itab (custom view attributes)

MdxHierachyCache

1999997

Cache for hierarchical MDX queries

SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

Cache activation / deactivation: indexserver.ini -> [cache] -> hierarchies_transactional_cache_enabled

Time after which an entry is marked as stale (in s, default: 14400): indexserver.ini -> [mdx] -> cache_entry_timeout

Action for stale entries (0 -> purge when needed, 1 -> purge immediately): indexserver.ini -> [mdx] -> cache_entry_timeout_action

MDX entity cache

Pool/entityCache

 MdxEntityCache

1999997

Cache for MDX entities

 SQL: "HANA_Memory_Caches_Overview"

SQL: "HANA_Memory_Caches_Entries"

 

Metadata cache

Pool/Metadata/MetadataCache/MetadataGlobalCacheSlot

 

1999997

Cache for metadata (SAP HANA >= 1.00.120)

SQL: "HANA_Metadata_Cache"  

Page cache

Pool/PersistenceManager/PersistentSpace/DefaultLPA/Page

 

1999997

SAP HANA file system cache

SQL: "HANA_Memory_TopConsumers"
hdbcons 'pageaccess a'

 

Result cache

Pool/CacheMgr/CS_QueryResultCache[Realtime]

Pool/CacheMgr/CS_QueryResultCache[TimeControlled]

CS_QueryResultCache[Realtime]CS_QueryResultCache[TimeControlled]

2014148

Cache for query results

SQL: "HANA_Memory_Caches_Overview"
SQL: "HANA_Memory_Caches_Entries"

indexserver.ini -> [cache] -> resultcache_clear_reconfig
indexserver.ini -> [cache] -> resultcache_enabled
indexserver.ini -> [cache] -> resultcache_maximum_value_size_in_bytes
indexserver.ini -> [cache] -> resultcache_minimum_query_execution_time_in_milliseconds
indexserver.ini -> [cache] -> resultcache_white_list

Single value cache

Pool/SingleValueCacheBuilder

 

1980765

Caches values of columns with only one single value

 

indexserver.ini -> [cache] -> enable_single_value_caching

SQL cache

Pool/RowEngine/SQLPlan

 

2124112

Cache for prepared SQL statements

SQL: "HANA_Memory_SQLCache_TopConsumers"
SQL: "HANA_SQL_SQLCache_Overview"

indexserver.ini -> [sql] -> plan_cache_size

System replication asynchronous buffer

Pool/PersistenceManager/DisasterRecoveryPrimary

 

1999880

Cache for asynchronous system replication

SQL: "HANA_Memory_TopConsumers"
hdbcons 'replication info'

<service>.ini -> [system_replication] -> logshipping_async_buffer_size

System replication log replay cache

Pool/PersistenceManager/DisasterRecoverySecondary/ReplayLogCache

 

1999880

Cache used with system replication mode logreplay[_readaccess] for redo log data to be applied on secondary site

SQL: "HANA_Memory_TopConsumers"
hdbcons 'replication info'

<service>.ini -> [system_replication] -> logshipping_replay_logbuffer_cache_size

Translation table cache

Pool/JoinEvaluator/TranslationTable

 

1998599

Translation table cache for join column mapping

SQL: "HANA_Heap_TranslationTables" 

indexserver.ini -> [joins] -> translator_cache_size

Static result cache

Pool/RowEngine/ViewCache (<= 1.0 SPS 11)

Pool/ResultCache(for cached view) (>= 1.0 SPS 12)

 

2336344

Static cache for query results

SQL: "HANA_Memory_StaticResultCache" 

indexserver.ini -> [result_cache] -> before_analytic_privilege
indexserver.ini -> [result_cache] -> enabled
indexserver.ini -> [result_cache] -> total_size

Dynamic result cache

Pool/DynamicCachedView

Pool/DynamicCachedView/ViewMatching

 

2506811

Dynamic cache for query results

SQL: "HANA_Memory_DynamicResultCache"

indexserver.ini -> [result_cache] -> enabled
indexserver.ini -> [result_cache] -> total_size

Dynamic tiering relocation cache

 

 

2777465

Cache for dynamic tiering results

  esserver.ini -> [row_engine] -> enable_relocation_cache

 

 

Cache Control

  • Cache framework에 속한 Cache이므로 resource manager에 의해서 전체 size는 관리됨
  • 개별 Cache는 Size에서 제한이 없기 때문에 만약 충분한 메모리가 주어진다면 Cache는 눈에 띄게 증가할 수 있음
    -> 정상 상태로 문제가 되지 않음
  • Framework의 cache를 clear 가능 (SPS03부터)
    • ALTER SYSTEM CLEAR CACHE ('<cache_id>')
    • <cache_id> = M_CACHES.CACHE_ID
  • Framework에 속하지 않은 Cache는 파라미터로 관리 됨
    • translator_cache_size - Translation table cache
    • plan_cache_size - SQL cache
  • Cache Framework
    • Cache는 다른 방식으로 구현되며 일부는 개별적으로 조회 가능 (heap allocator sizes를 통해서)
    • M_CACHES, M_CACHE_ENTRIES를 통해 조회 가능