SET_DATA_COLLECTOR_TIME_POLICY

Sets a time capacity for individual Data Collector tables on all nodes. If nodes are down, the failed nodes receive the setting when they rejoin the cluster.

If you specify interval, Vertica enforces the setting that is exceeded first (size or time). Before you include a time restraint, verify that the disk size capacity is sufficiently large.

If you want to configure both time and size restraints at the same time, see SET_DATA_COLLECTOR_POLICY.

Syntax

SET_DATA_COLLECTOR_TIME_POLICY( ['component',] 'interval' )

Parameters

component

[Optional] Configures the time retention policy for the specified component. If you omit the component argument, Vertica sets the specified time capacity for all Data Collector tables.

interval

Specifies the time restraint on disk using an INTERVAL type. To disable a time restraint, set interval to -1.

Any negative input turns off the time restraint

Privileges

Superuser

Usage Considerations

  • Before you change a retention policy, view its current setting by calling the GET_DATA_COLLECTOR_POLICY function.
  • If you don't know the name of a component, query the V_MONITOR.DATA_COLLECTOR system table for a list. For example:

    => SELECT DISTINCT component, description FROM data_collector 
       ORDER BY 1 ASC; 

Setting the Time Interval for System Tables

You can also use the interval argument to query system tables the same way you query Data Collector tables; for example:

set_data_collector_time_policy('<system-table>', <'interval'>);

To illustrate, the following command in the left column is equivalent to running the series of commands on the right:

Run one command Instead of a series of commands
SELECT set_data_collector_time_policy
  ('v_monitor.query_requests', 
  '3 minutes'::interval);
SELECT set_data_collector_time_policy
  ('RequestsIssued', 
  '3 minutes'::interval);

SELECT set_data_collector_time_policy
  ('RequestsCompleted', 
  '3 minutes'::interval);

SELECT set_data_collector_time_policy
  ('Errors', 
  '3 minutes'::interval);

SELECT set_data_collector_time_policy
  ('ResourceAcquisitions', 
  '3 minutes'::interval);

The SET_DATA_COLLECTOR_TIME_POLICY function updates the time capacity for all Data Collector tables in the V_MONITOR.QUERY_REQUESTS view. The new setting overrides any previous settings for every Data Collector table in that view.

Examples

The following command configures the Backups component to be retained on disk for 1 day:

=> SELECT set_data_collector_time_policy('Backups', '1 day'::interval);     
 set_data_collector_time_policy
--------------------------------
 SET
(1 row)

This command disables the 1-day restraint for the Backups component:

=> SELECT set_data_collector_time_policy('Backups', '-1');
 set_data_collector_time_policy
--------------------------------
 SET
(1 row)

This command sets a 30-minute time capacity for all Data Collector tables in a single command:

=> SELECT set_data_collector_time_policy('30 minutes'::interval);
 set_data_collector_time_policy
--------------------------------
 SET
(1 row)

To view current retention policy settings for each Data Collector table, call the GET_DATA_COLLECTION_POLICY() function. In the next example, the time restraint is included.

=> SELECT get_data_collector_policy('RequestsIssued');          
                        get_data_collector_policy
-----------------------------------------------------------------------------
 2000KB kept in memory, 50000KB kept on disk. 2 years 3 days 15:08 hours kept
 on disk.
(1 row)

If the time policy setting is disabled, the output of GET_DATA_COLLECTION_POLICY() returns "Time based retention disabled."

2000KB kept in memory, 50000KB kept on disk. Time based retention disabled.