I have written this query (which returns only 67 records, which is fine)
The problem is with the query time, the Query took 0.0042 seconds which is slow, I heard that indexes can help fasten the query, shall I add indexes on
UserID or OfficeID?
SELECT Distinct(u.UserID), u.Role, u.FirstName, u.LastName, u.Email FROM Users as u, Hires as h, Contractors as c, ContractorCompanies as cc where (u.UserID = h.User_ID AND h.Offices_OfficeID = 3) OR (u.UserID = c.User_ID AND c.Offices_OfficeID = 3) OR (u.UserID = cc.User_ID AND cc.Offices_OfficeID = 3)
Updated: When I added an index on UserID the Query took 0.0066 seconds.)