Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Even if the indexed column doesn't have many distinct values, an index is beneficial in cases when the value you're searching for is uncommon. In other words, the index helps when the search is more <em>selective</em>, and matches a small percentage of rows.</p> <p>So in this case, the decision about creating an index is based on what percentage of rows match your conditions <code>scrape_status=1</code> and <code>parse_status=0</code>. For example, suppose <code>scrape_status=1</code> matches 2% of rows, and <code>parse_status=0</code> matches 1% of rows, I'd want to use <code>parse_status</code> as the leading column for the index. </p> <p>If that's the case, but nearly all rows with <code>parse_status=0</code> also have <code>scrape_status=1</code>, then there may be little additional benefit to making a compound index. Whereas if <code>scrape_status=1</code> is effective at further restricting the matching rows, then you'd definitely want it to be built into the index.</p> <p>MySQL also has optimizations for LIMIT. see <a href="http://dev.mysql.com/doc/refman/5.6/en/limit-optimization.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.6/en/limit-optimization.html</a> It tries to bail out of the query as soon as it finds the desired number of matching rows. MySQL 5.6 has added some new optimizations in this area.</p> <p>MYSQL does not calculate the select-list expressions for rows that don't match conditions in the WHERE clause.</p> <p>However, MySQL <em>does</em> have to read rows of data from disk to evaluate them against the conditions in the WHERE clause. This I/O is the source of a lot of performance cost, and it's the reason that narrowing down the search with indexes is so important. And if your <code>source_html</code> column is a TEXT column containing long strings, it's likely that this adds further overhead to the I/O, because MySQL will have to read additional pages of data from disk (see <a href="http://www.mysqlperformanceblog.com/2010/02/09/blob-storage-in-innodb/" rel="nofollow">Blob Storage in Innodb</a> for more details). </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload