Can anyone tell me why this query takes 8 seconds to load?
I have a CRM app that i've build and this is my biggest query in there. this tables have about 50k-100k rows each and to join all of them and order by all the results takes about 8 seconds (8.0282 sec to be exact). does anyone have a better idea for me? I don't know what to do... > SELECT * FROM `leads` > INNER JOIN `customers` ON `customers`.`lead_id` = `leads`.`id` > INNER JOIN `quotes` ON `quotes`.`lead_id` = `leads`.`id` > INNER JOIN `lead_sources` ON `lead_sources`.`id` = `leads`.`source_id` > WHERE `leads`.`is_customer` =0 > AND `leads`.`archived` =0 > AND `customers`.`company_id` = 75005 > ORDER BY `customers`.`created_at` DESC