cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Forcing a Refresh of M_TABLE_PERSISTENCE_STATISTICS Statistics

benoit-schmid
Contributor
0 Kudos
316

Good Afternoon,

I have purged a table named ZEXAMPLE stored in SAPHANADB.

I check the disk size of this table with the following query:
SQL> select TABLE_NAME, DISK_SIZE from M_TABLE_PERSISTENCE_STATISTICS where SCHEMA_NAME='SAPHANADB' and TABLE_NAME='ZEXAMPLE';

But this query returns an old value, that does not take into account my deletions.

1. Would you know which Hana Job refreshes the table sizes statistics ?

2. How could I force a refresh of the M_TABLE_PERSISTENCE_STATISTICS for the table SAPHANADB.ZEXAMPLE ?

3. How could I force a refresh of the statistics for the tables that belong to the Schema SAPHANADB ?

Have a nice day.

Accepted Solutions (1)

Accepted Solutions (1)

benoit-schmid
Contributor
0 Kudos

Good morning,

I’m revisiting this question as it seems there has been no response so far.
It’s a pity — the SAP Community has unfortunately lost some of its engagement with recent platform upgrades.

For anyone who might encounter the same issue, and since SAP’s documentation on this topic is not very detailed, here are the key points and steps that may help:


🔹Job Responsible for Refreshing the Statistics

The job that updates these statistics is View Global_Table_Persistence_Statistics with ID 5010.

To check when these statistics were last updated, connect to the HANA tenant corresponding to your ABAP instance, and run the following commands:

su - sidadm
hdbsql -i 00 -d SID localhost:30013 -u system
SQL> SELECT ID, STATUS, INTERVALLENGTH, RETENTION_DAYS_DEFAULT, LATEST_START_SNAPSHOT_ID FROM _SYS_STATISTICS.STATISTICS_SCHEDULE WHERE ID = 5010;

Example output:
5010, "Idle", 60, 365, "2025-11-05 06:42:50.000000000"


🔹Triggering the Job Manually

SAP does not provide a built-in tool to trigger this job manually (“Start Now”).
The simplest approach is to temporarily reduce the job interval so that it runs sooner.

Below is an example procedure:

  1. Check the ABAP spool (SP01) disk size
    SELECT (disk_size) FROM m_table_persistence_statistics WHERE table_name='TST03';
    Example result: 5129850464

  2. Check when the job last ran
    SELECT ID, STATUS, INTERVALLENGTH, RETENTION_DAYS_DEFAULT, LATEST_START_SNAPSHOT_ID FROM _SYS_STATISTICS.STATISTICS_SCHEDULE WHERE ID = 5010;

  3. Temporarily set the interval to 1 minute
    UPDATE _sys_statistics.statistics_schedule SET intervallength=60 WHERE ID=5010;

  4. Verify the job execution
    SELECT ID, STATUS, INTERVALLENGTH, RETENTION_DAYS_DEFAULT, LATEST_START_SNAPSHOT_ID FROM _SYS_STATISTICS.STATISTICS_SCHEDULE WHERE ID = 5010;

  5. Restore the default interval
    UPDATE _sys_statistics.statistics_schedule SET intervallength=21600 WHERE ID=5010;

  6. Confirm that the statistics have been refreshed
    SELECT (disk_size) FROM m_table_persistence_statistics WHERE table_name='TST03';
    Example updated value: 5107056784


I hope this helps others facing the same question.
Have a great day

Answers (0)