This is my query:
SELECT tableA.id, var1, var2, var3, var4, var5
FROM tableA
LEFT JOIN tableB
ON tableA.id = tableB.id
WHERE tableB.category = 'example'
ORDER BY var3 DESC
I'm not actually returning any data from tableB, all I'm doing is checking the table to see if the category matches 'example', and if so I'm returning the matching ID and data from tableA.
Is there a better / faster option than using LEFT JOIN here?