title: MySQL JOIN Query Index optimization
body: <p>I have this query. Assuming no index is created yet, how can i optimize this using index so the query runs faster? How do i create the index?</p>
  
  <pre><code>select c.company_name, c.company_id 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 = 10;
  </code></pre>
  
  <p>Any help would greatly be appreciated.</p>