• Sean Lange (5/25/2016)


    gjuarez (5/24/2016)


    The table has 67404675, i need to keep 180 days, I calculated about 10,000000 for a year.

    So you are only going to keep 180 rows out of 67,404,675 rows? If that is the case you shouldn't bother trying to delete anything. Just copy the 180 rows into another table. Then drop the existing massive table. Then rename the newly created table to the original table name.

    That seems quite a dodgy solution.

    They say that they have set up a job to do this. To me that implies this will be run repeatedly as part of normal operation of the system.

    What happens if, for whatever reason, the rename of the new table back to the normal table name fails?

    Whatever application is using the database will error whenever it tries to write audit information; changing DB schema as part of normal operation seems like a road to pain.