Years ago, my referrals table identified the recipient by just an email address. I have since upgraded the table to record the recipient’s first and last name. I use the query below to see if the recipient of a referral ever took the time to signup for their own account. But I’m starting to see the doing the join with an email address can be very slow. Any suggestions from you wise database gurus? Maybe I should remove the ability for my website members to see if a recipient has created their own account. The following will show all the referrals that user 717 has sent.
Thanks!
SELECT
r.rID,
r.firstName,
r.lastName,
r.recipientEmail,
r.testimonial,
r.dateArrived,
u.uID as registered
FROM referrals r
LEFT JOIN users u
on r.recipientEmail = u.email
WHERE r.uID = 717
ORDER BY rID desc