title: Are multiple indexes involving the same column useful or not?
body: <p>I have a table called clicks which records mouse clicks around a website. The schema looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/KEi9F.png" alt="enter image description here"></p>
  
  <p>There are 3 main queries run on this data:</p>
  
  <ul>
  <li>"SELECT * WHERE pageid = xxxx" </li>
  <li>"SELECT * WHERE visitorid = xxx AND pageid = xxxx"</li>
  <li>"SELECT visitorid, MIN(time) AS mintime WHERE pageid = xxxx GROUP BY visitorid"</li>
  </ul>
  
  <p>In the future I might use maintestid in queries too. So this would look like:</p>
  
  <ul>
  <li>"SELECT * WHERE maintestid = xxxx"</li>
  </ul>
  
  <p>So I've added 2 indexes to the table for both these queries along with the primary key like so:</p>
  
  <p><img src="https://i.stack.imgur.com/UcI7Y.png" alt="enter image description here"></p>
  
  <p>I have 3 questions:</p>
  
  <ol>
  <li><p>Is this primary key useful at all being like this? Or should I make it the ID column only?</p></li>
  <li><p>Is the pageid index useful at all? Or will it be just as fast if all queries for pageid are be handled by the pageid_visid index?</p></li>
  <li><p>When I want to search via maintestid in the future, should I just add an index on the maintestid column, or something different?</p></li>
  </ol>