title: MySQL multiple columns in IN clause
body: <p>I have a database with four columns corresponding to the geographical coordinates x,y for the start and end position. The columns are: </p>
  
  <ul>
  <li>x0</li>
  <li>y0</li>
  <li>x1</li>
  <li>y1</li>
  </ul>
  
  <p>I have an index for these four columns with the sequence x0, y0, x1, y1.</p>
  
  <p>I have a list of about a hundred combination of geographical pairs. How would I go about querying this data efficiently?</p>
  
  <p>I would like to do something like this as suggested on <a href="https://stackoverflow.com/questions/13027708/sql-multiple-columns-in-in-clause">this SO answer</a> but it only works for Oracle database, not MySQL:</p>
  
  <pre><code>SELECT * FROM my_table WHERE (x0, y0, x1, y1) IN ((4, 3, 5, 6), ... ,(9, 3, 2, 1));
  </code></pre>
  
  <p>I was thinking it might be possible to do something with the index? What would be the best approach (ie: fastest query)? Thanks for your help!</p>
  
  <p>Notes:</p>
  
  <ul>
  <li>I cannot change the schema of the database</li>
  <li>I have about 100'000'000 rows</li>
  </ul>
  
  <p><strong>EDIT:</strong>
  The code as-is was actually working, however it was extremely slow and did not take advantage of the index (as we have an older version of MySQL <code>v5.6.27</code>). </p>