in reply to Re^4: Speed up file write taking weeks
in thread Speed up file write taking weeks

Does the performance improve if you change the query to use proper JOINs instead?

insert in table T_3_XYZ ( t_3_id , t_3_data_1 , t_3_data_2 ) select distinct t_1_id , t_1_data_1 , t_2_data_2 from T_1_DAT inner join T_2_KEY on t_1_id = t_2_id

Ideally the query optimizer would recognize that the original WHERE clause is identical to the INNER JOIN clause, but maybe it doesn't?