Platform Analytics makes use of fact tables for displaying data contained in the Platform Analytics Repository. By default, Platform Analytics keeps all the fact tables in its Repository for a period of 180 days. After this number of days is surpassed, all the data contained in the fact tables will pass to the historical fact tables. This period is set by default in the PAConsumerConfig.yaml file, please review the KB485690 for understanding better how to modify this limit.
If older data was moved to historical Platform Analytics tables, then this moved data will not return to current fact tables on its own automatically. The purpose of this article is to explain how to do it.
This is a default setting provided by Strategy to guarantee an adequate performance of Platform Analytics. In this way we avoid the saturation of the fact tables, and it makes easier and faster to retrieve the data. If the user needs to have access to tables older than 180 days in the current fact tables, then it is needed to transfer the data.
It is possible to move the data from historical tables to current fact tables:
SELECT count(*) FROM platform_analytics_wh.historical_access_transactions;SELECT count(*) FROM platform_analytics_wh.historical_fact_action_cube_cache;SELECT count(*) FROM platform_analytics_wh.historical_fact_action_security_filter;SELECT count(*) FROM platform_analytics_wh.historical_fact_object_change_journal;SELECT count(*) FROM platform_analytics_wh.historical_fact_performance_monitor;SELECT count(*) FROM platform_analytics_wh.historical_fact_prompt_answers group;SELECT count(*) FROM platform_analytics_wh.historical_fact_report_columns;SELECT count(*) FROM platform_analytics_wh.historical_fact_sql_stats;SELECT count(*) FROM platform_analytics_wh.historical_fact_step_sequence;SELECT count(*) FROM platform_analytics_wh.historical_lu_session;
SELECT count(*) FROM platform_analytics_wh.access_transactions; SELECT count(*) FROM platform_analytics_wh.fact_action_cube_cache; SELECT count(*) FROM platform_analytics_wh.fact_action_security_filter; SELECT count(*) FROM platform_analytics_wh.fact_object_change_journal; SELECT count(*) FROM platform_analytics_wh.fact_performance_monitor; SELECT count(*) FROM platform_analytics_wh.fact_prompt_answers; SELECT count(*) FROM platform_analytics_wh.fact_report_columns; SELECT count(*) FROM platform_analytics_wh.fact_sql_stats; SELECT count(*) FROM platform_analytics_wh.fact_step_sequence; SELECT count(*) FROM platform_analytics_wh.lu_session;
INSERT INTO access_transactions SELECT * FROM historical_access_transactions; INSERT INTO fact_action_cube_cache SELECT * FROM historical_fact_action_cube_cache; INSERT INTO fact_action_security_filter SELECT * FROM historical_fact_action_security_filter; INSERT INTO fact_object_change_journal SELECT * FROM historical_fact_object_change_journal; INSERT INTO fact_performance_monitor SELECT * FROM historical_fact_performance_monitor; INSERT INTO fact_prompt_answers SELECT * FROM historical_fact_prompt_answers; INSERT INTO fact_report_columns SELECT * FROM historical_fact_report_columns; INSERT INTO fact_sql_stats SELECT * FROM historical_fact_sql_stats; INSERT INTO fact_step_sequence SELECT * FROM historical_fact_step_sequence; INSERT INTO lu_session SELECT * FROM historical_lu_session;
TRUNCATE TABLE platform_analytics_wh.historical_access_transactions; TRUNCATE TABLE platform_analytics_wh.historical_fact_action_cube_cache; TRUNCATE TABLE platform_analytics_wh.historical_fact_action_security_filter; TRUNCATE TABLE platform_analytics_wh.historical_fact_object_change_journal; TRUNCATE TABLE platform_analytics_wh.historical_fact_performance_monitor; TRUNCATE TABLE platform_analytics_wh.historical_fact_prompt_answers; TRUNCATE TABLE platform_analytics_wh.historical_fact_report_columns; TRUNCATE TABLE platform_analytics_wh.historical_fact_step_sequence; TRUNCATE TABLE platform_analytics_wh.historical_lu_session; TRUNCATE TABLE platform_analytics_wh.fact_sql_stats;
NOTE: Be aware that increasing too much the amount of data in the current tables may lead to a performance repercussion or a bigger amount of memory will be needed depending on the amount of data managed and contained in the tables.