Given the following query, how could it be optimized? list all assumptions
Code:
select c.* FROM companies AS c JOIN users AS u USING(companyid) JOIN jobs as J USING(userid) JOIN useraccounts AS ua USING (userid) WHERE j.jobid = 123;
Could anyone give me suggestions as to what can be done?
[eluser]Rick Jolly[/eluser]
[quote author="garymardell" date="1266703960"]SELECT c.* is slower than listing all the fields that need to be selected for a start.[/quote]
If he really needs all the fields, then SELECT * is most likely faster.