Page 1 of 1

strategy: partitioned table, delete millions of rows

PostPosted: Wed Aug 17, 2022 2:47 pm
by BobHarris
Hello,
I've have a question about deleting millions of rows of partitioned table.
There are 12 table partitions for storing specific customer data.
Each partition holds up data for 3 months, so that these 12 partitions
store data for the last 3 years. I want to delete all records of the
4 oldest partitions and use them then as the paritions for thew newest
customer data coming in. It's like a ring buffer, that holds data for the
past 3 years.

Locking the 4 partitions and deleting all corresponding rows takes too much time
and would prevend new customer data from beeing stored.

I have two ideas how to delete the corresponding records.
1) delete/remove old partitions, create new partitions
2) delete a creatin amount of records of the partitions block wise on a daily basis.

Is there a better way how to delete the old partitions very fast ? What about idea 1. Could that work ?

kind regards,
bob harris

Re: strategy: partitioned table, delete millions of rows

PostPosted: Tue Sep 20, 2022 1:56 pm
by engh
Hello

A LOAD DUMMY with "LOG NO" option takes less than one second, even if there are millions or billions of rows !

That's the best way to remove all records from a partition or a table