Insert/* + append */into get_add_column_test
Select a. *, row_number () over (partition by imei order by logtime) rn
The from get_add_column3 a
Where not the exists (select 1 from tt_column c where Anderson, mei=c.i mei);
Get_add_column3 a total of more than 4000 ten thousand records, tt_column probably around 300 w record and only IMEI to heavy data,
Because this two tables are inserted into the generated temporary tables, so no index,
Originally used for half an hour can perform almost finished, now to do more than three hours, sometimes takes 5 hours to perform, ask ace to optimize,
CodePudding user response:
There is not much optimization space, from index to begin!CodePudding user response:
1, can consider to rewrite the minus look at efficiency when2, the target table had better guide or TRUNCATE, regularly because append more debris, time may be slower and slower,