title: How to retrieve column selectivity metadata in MySQL, without creating an index?
body: <p>Assuming the following SQL query:</p>
  
  <pre><code>SELECT col1,col2 from table where col1 &gt; 5 and col2 &gt; 8
  </code></pre>
  
  <p>I believe that MySQL won't be able to look up in both columns using the same table index, because both conditions are range conditions.
  Therefore, I'm trying to understand what will be the best way to figure out which column to index in such scenario (which is probably the most selective one).</p>
  
  <p>Is MySQL metadata accessible in a way that will allow one to identify whether column A or B are more selective, without actually creating the indexes for both options and looking at the cardinality information?</p>
  
  <p>Edit: to clarify, the goal is to find a way to do that even for queries that take forever to run without the indexes (so counting rows is out of question in this case).</p>