In Vertica the Tuple Mover process is responsible for purging old data. The data that is eligible for purging will listen to the value that the HistoryRetentionTime parameter is set. The default value of this parameter is set to -1, this values tells Vertica that no deleted data will be saved and once the Tuple Mover executes the deleted data will be purged.
(dbadmin@:5433) [dbadmin] * SELECT SET_CONFIG_PARAMETER('HistoryRetentionTime', '600' );
SET_CONFIG_PARAMETER
----------------------------
Parameter set successfully
(1 row)
(dbadmin@:5433) [dbadmin] * select get_config_parameter('HistoryRetentionTime');
get_config_parameter
----------------------
600
(1 row)
dbadmin@:5433) [dbadmin] create table one(id int);
CREATE TABLE
(dbadmin@:5433) [dbadmin] select current_epoch,ahm_epoch,last_good_epoch from system;
current_epoch | ahm_epoch | last_good_epoch
---------------+-----------+-----------------
909 | 908 | 908
(1 row)
-- check the epoch values from the system table
(dbadmin@:5433) [dbadmin] * select current_epoch,ahm_epoch,last_good_epoch from system;
-[ RECORD 1 ]---+----
current_epoch | 909
ahm_epoch | 908
last_good_epoch | 908
(dbadmin@:5433) [dbadmin] * insert into one values(1);
OUTPUT
--------
1
(1 row)
(dbadmin@:5433) [dbadmin] * commit;
COMMIT
(dbadmin@:5433) [dbadmin] insert into one values(1);
OUTPUT
--------
1
(1 row)
(dbadmin@:5433) [dbadmin] * commit;
COMMIT
(dbadmin@:5433) [dbadmin] select * from one;
id
----
1
1
(2 rows)
(dbadmin@:5433) [dbadmin] * select current_epoch,ahm_epoch,last_good_epoch from system;
-[ RECORD 1 ]---+----
current_epoch | 911
ahm_epoch | 908
last_good_epoch | 908
(dbadmin@:5433) [dbadmin] * delete from one ;
-[ RECORD 1 ]
OUTPUT | 2
(dbadmin@:5433) [dbadmin] * commit;
COMMIT
(dbadmin@:5433) [dbadmin] select current_epoch,ahm_epoch,last_good_epoch from system;
-[ RECORD 1 ]---+----
current_epoch | 912
ahm_epoch | 908
last_good_epoch | 908
(dbadmin@:5433) [dbadmin] * insert into one values(2);
-[ RECORD 1 ]
OUTPUT | 1
(dbadmin@:5433) [dbadmin] * commit;
COMMIT
(dbadmin@:5433) [dbadmin] * select * from one;
id
----
2
(1 row)
(dbadmin@:5433) [dbadmin] * at epoch 910 select * from one;
id
----
1
1
(dbadmin@:5433) [dbadmin] * SELECT SET_CONFIG_PARAMETER('HistoryRetentionTime', '-1');
SET_CONFIG_PARAMETER
----------------------------
Parameter set successfully
(1 row)
(dbadmin@:5433) [dbadmin] * ALTER DATABASE dcg023 clear HistoryRetentionTime;
ALTER DATABASE