Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>The <code>DESCRIBE</code> looks great, a simple one liner.</p> </blockquote> <p>Since you are using only one table in your query it cannot be anything other than a one-liner.</p> <p>However, your query does not use the <code>FULLTEXT</code> index.</p> <p>For the index to be usable, you should rewrite the query a little:</p> <pre><code>SELECT * FROM sqinquiries_inquiry WHERE MATCH (names, emails) AGAINST ('smith' IN BOOLEAN MODE) ORDER BY id DESC LIMIT 100 </code></pre> <p><code>MATCH</code> only uses the index if the you match against the exact set of columns the index is defined on.</p> <p>So your query uses the index scan on <code>id</code>: <code>Using index; Using where</code> at the very end of your <code>DESCRIBE</code>.</p> <p><code>Sending data</code> is quite misleading: this is actually time elapsed between the end of the previous operation and the end of the current operation.</p> <p>For instance, I just ran this query:</p> <pre><code>SET profiling = 1; SELECT * FROM t_source WHERE id + 1 = 999999; SHOW PROFILE FOR QUERY 39; </code></pre> <p>which returned a single row and this profile:</p> <pre><code>'starting', 0.000106 'Opening tables', 0.000017 'System lock', 0.000005 'Table lock', 0.000014 'init', 0.000033 'optimizing', 0.000009 'statistics', 0.000013 'preparing', 0.000010 'executing', 0.000003 'Sending data', 0.126565 'end', 0.000007 'query end', 0.000004 'freeing items', 0.000053 'logging slow query', 0.000002 'cleaning up', 0.000005 </code></pre> <p>Since the index is not usable, <code>MySQL</code> needs to perform the full table scan.</p> <p><code>0.126565</code> seconds are the time from the beginning of the execution (the time the first row was read) and the end on the execution (the time the last row was sent to the client).</p> <p>This last row is at the very end of the table and it took a long time to find and send it.</p> <p><code>P. S.</code> Edited to remove the downvote :)</p>
 

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