batch delete
I have couple of tables with 20 and 300+ mil rows. My application team needs to design a purge process to delete some of the rows based on currently unknown criteria. I don't want to run a delete because of its overhead and I'm planning the following approach
- create a temporary table with the same layout as the one to be purged
- copy the data from the base table into the temporary table except for the ones that need to be deleted (something like insert into temp_table (select * from base_table where < currently unknown condition>)
- truncate the base table, drop indices