HANA – table unload priorities
many people still think all data in HANA which exists in the data area also loaded into memory all the time. Of course there are some techniques which influence the unload / placement of tables e.g. data aging and the non-active data concept of BW. Usually unloads happen based on a “least recently used” (LRU) approach, so the columns having not being used for the longest time are unloaded first. So HANA decides when it makes sense to unload some tables to free memory.
But what about your own tables? Can you also take influence when data are unoaded? For general information you can refer to 2127458 – FAQ: SAP HANA Loads and Unloads. Ok you can manually unload or load tables. But you want to do this automatically and want to understand when tables are loaded or unloaded.
Ok, may be you know the un-/load traces on the filesystem. But you don’t know why this happen.
At first you have to know that there are unload priorities:
Than you need to know about the different disposition weights a table can have:
You can select the current unload prio values from sys.tables:
select table_name, unload_priority from sys.tables;
You can see this dispositions if you use the tool hdbcons with option ‘pageaccess a’:
As you may be know the RowStore uses the shared memory of the linux system and with HANA it can’t be unloaded from memory. So the type RowStorePage has every time the disposition ‘Nonswappable’.
Per default a CS table has the unload priority 5. The last access is 10 hours ago.
The Page Cache has the unload priority short term and the last access is one hour ago.
The column table has the lower result value (270 vs. 300) and so it is unloaded earlier than the pages of the page cache.
If there are tables that should in general be replaced earlier or later, you can prioritize unloads using the UNLOAD PRIORITY setting:
ALTER TABLE "<table_name>" UNLOAD PRIORITY <priority>;
The SAP standard tables shouldn’t be changed without any good reason.
Now you know how and when your tables are unloaded. If you need more details you can use the following notes: