1

Is there a way to add retention on PostgreSQL? I've tried partitioning but seems to be a problem when querying between multiple partitioning regarding performance. This seemed to be a better way because you can delete one partition in a fast way then deleting few years of data.

Shagoon
  • 11
  • 1
  • 5
  • First of all: do not ask two, loosely related questions in one SO post. Make them into two SO questions. Secondly: partitioning is a good approach. What exactly do you mean by performance problem? Did you measure how the performance degrades? – freakish May 06 '20 at 16:26

1 Answers1

0

Partitioning is the king's way for getting rid of old data.

Most of your queries will get slightly slower, but that shouldn't be too bad if you use a moderate number of partitions.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263