Skip to main content

Managing Disk space by deleting the older records when the disk is 60% full/

  • August 7, 2017
  • 3 replies
  • 11 views

rishireddy

Hi,
I am using vertica for an application which has continuous flow of data. So I want to manage the disk space by creating a cron job which will delete the older records once the disk is 60% full. Could someone please help me to achieve the same.

3 replies

marcothesane
Forum|alt.badge.img+1
  • Participating Frequently
  • August 7, 2017

Calculate the time interval that is covered by "60% of disk space".
If it's, for example, 2 years, then create your table: PARTITIONED BY YEAR(transaction_date)*100 + MONTH(transaction_date).
Then, once a day, for example, check if you reach 60% of disk space, using "df", for example, and collecting that command's output. If yes, then, run VSQL to drop the oldest partition. Check the Vertica documentation on the DROP_PARTITION() function.


rishireddy
  • Author
  • New Participant
  • August 7, 2017

Thanks for the reply. Could you please let me know how to create partition based on day to day.


peterjansens
Forum|alt.badge.img
  • Participating Frequently
  • August 7, 2017