I have two tables: costumer and phone. The costumer table has about 2 million rows and the phone table has about 5 million rows.
everyday this table is updated trough a PHP application. we receive an excel datasheet with 5000 new records(costumers and phones).
The application check if the costumers and their phones in the sheet are already registered, so it updates or inserts the new records.
The query takes a long time to execute, I believe it happens because of the multiples checks I have to do in the phone table. Is there a way to speed up the things?