I need to delete rows from a table based on what is present in a temporary table.
For me, both of these statements work :
DELETE from main_table where `id` in (select `deletable_id` from temporary_table);
and
DELETE main_table from main_table join temporary_table on main_table.id = temporary_table.deletable_id;
Which of the two is advisable to use given the fact that main_table will be having a billion of rows and the temporary will have a few thousands.