Archives of the TeradataForum
Message Posted: Fri, 05 Sep 2014 @ 20:47:09 GMT
What is the most efficient way to delete (say < 50,000) records from a table which has 1.5 billion records? Here is the query and data demographics. The PPI in TABLE1 is not being used due to the condition T1.DATE_CLOUMN1 > T2.DATE_COLUMN2.
DELETE T1 FROM TABLE1 T1, TABLE2 T2, TABLE3 T3 WHERE T1.COLUMN1= T2.COLUMN1 AND T1.COLUMN1= T3.COLUMN1 AND T1.DATE_CLOUMN1 > T2.DATE_COLUMN2 AND T2.COLUMN3 ='ABC' T1.COLUMN1 IS INTEGER and part of the UPI in TABLE1 T1.DATE_COLUMN1 is DATE and PPI of TABLE1 T2.COLUMN1 is INTEGER and not part of any index in TABLE2 T2.DATE_COLUMN2 is DATE and not part of any index in TABLE2 T3.COLUMN1 is INTEGER and part of UPI in TABLE3 Record count TABLE1 - 1.5 Billion TABLE2 - 93 TABLE3 - 97
|Copyright 2016 - All Rights Reserved|
|Last Modified: 24 Jul 2020|