Finding differences between two tables takes too long
Create the result table, my_diff, without index, and when it is
populated, add the desired index.
Make sure you have an index on (name, type) in both tables. i.e. a composite index
It is not a good idea to have primary key on all fields. This is especially true if you are using InnoDB engine. Instead, alter the table to add an integer auto increment field as primary key, and if needed, add a composite unique index on the fields you want to be unique.


From your explain result, it looks like you don't have the index on (name, type), so for each row in AA, it will do a full  scan to BB. This is one enough reason to make the query slow.