deleting a large number of rows from a table

Posted by Azeem on Stack Overflow See other posts from Stack Overflow or by Azeem
Published on 2010-04-05T15:58:51Z Indexed on 2010/04/05 19:53 UTC
Read the original article Hit count: 193

Filed under:
|
|

We have a requirement to delete rows in the order of millions from multiple tables as a batch job (note that we are not deleting all the rows, we are deleting based on a timestamp stored in an indexed column). Obviously a normal DELETE takes forever (because of logging, referential constraint checking etc.). I know in the LUW world, we have ALTER TABLE NOT LOGGED INITIALLY but I can't seem to find the an equivalent SQL statement for DB2 v8 z/OS. Any one has any ideas on how to do this really fast? Also, any ideas on how to avoid the referential checks when deleting the rows? Please let me know.

© Stack Overflow or respective owner

Related posts about db2

Related posts about zos