I’m trying to optimise my queries to make the website load faster
SELECT ac.id as id, ac.first_name, ac.last_name, ac.email, ac.company_name, upd8r_twitter_accts.id as twitter, upd8r_facebook_accts.id as facebook
FROM upd8r_user_accts ac
LEFT OUTER JOIN upd8r_twitter_accts ON ac.id = upd8r_twitter_accts.user_id
LEFT OUTER JOIN upd8r_facebook_accts ON ac.id = upd8r_facebook_accts.user_id
WHERE ac.`rfid` = '' AND ac.last_name != '' AND ac.`owner_id` = '114'
ORDER BY ac.`last_name` asc
without the joins the query runs in 0.0001 seconds but with the joins it runs 0.3432 seconds..
How do i go about speeding this up?
Create the following indexes: