Vertica中的User_Sessions

时间:2016-05-17 08:43:19

标签: vertica

我有一个要求,我必须捕获最近几个月的user_session详细信息。当我查询user_sessions表时,我只有最近三天,四天的信息。无论如何,我们可以获得过去6个月的user_sessions详细信息吗?

谢谢你, Sadagopan

1 个答案:

答案 0 :(得分:1)

User_session is a view on top of 3 diffract data collectors tables , data collectors tables include info about many events and activity’s exists on Vertica , this info is being persists on disk with some default retention period . You have two main options to have 6 months historical view of your sessions 1. Change the setting of the retention period of relevant DC tables to 6Mounts 2. Develop a script or process that will run each few days and merge the content of the user_session to user define local table .

For options #1 you need to run the below API for each one of the DC tables (be careful using this options require extra disk space on the Vertica side ) .

SELECT set_data_collector_time_policy('SessionEnds', '1 day'::interval);
SELECT set_data_collector_time_policy('SessionStarts', '1 day'::interval);
SELECT set_data_collector_time_policy('RuntimePriorityChanges', '1 day'::interval);