I have a huge DB that I want to scale down, to only look at my area of interest. Initially I wanted to write the records I'm interested in onto a new database and table. However, this is taking for ever, so I'm wondering if it might be faster to delete the records I do not want. I already got a copy of the database, so there would be no problem to delete.
Insert statement:
INSERT INTO NewTable (C1, C2, C3, C4, C5, C6, C7)
SELECT OldTable1.C1, OldTable1.C2, OldTable1.C3, OldTable1.C4, OldTable1.C5, OldTable1.C6, OldTable1.C7
FROM OldTable1
INNER JOIN OldTable2.C5 ON OldTable2.C5 = OldTable1.C5
WHERE OldTable2.C8 = 70
If I would delete I would delete all data from OldTable1 that did not match the inner join and where statement.