title: SQLite "LIKE" operator is very slow compared to the "=" operator
body: <p>When I am using the <code>LIKE</code> operator in SQLite, it is very slow compared to when I use the <code>=</code> instead.
  It takes about 14ms with the <code>=</code> operator, but when I use <code>LIKE</code>, it takes about 440ms. I am testing this with <code>DB Browser for SQLite</code>. Here is the query that works fast: </p>
  
  <pre><code>SELECT re.ENTRY_ID, 
         GROUP_CONCAT(re.READING_ELEMENT, '§') AS read_element,
         GROUP_CONCAT(re.FURIGANA_BOTTOM, '§') AS furigana_bottom,
         GROUP_CONCAT(re.FURIGANA_TOP, '§') AS furigana_top,
         GROUP_CONCAT(re.NO_KANJI, '§') AS no_kanji,
         GROUP_CONCAT(re.READING_COMMONNESS, '§') AS read_commonness, 
         GROUP_CONCAT(re.READING_RELATION, '§') AS read_rel,
         GROUP_CONCAT(se.SENSE_ID, '§') AS sense_id, 
         GROUP_CONCAT(se.GLOSS, '§') AS gloss, 
         GROUP_CONCAT(se.POS, '§') AS pos, 
         GROUP_CONCAT(se.FIELD, '§') AS field,
         GROUP_CONCAT(se.DIALECT, '§') AS dialect, 
         GROUP_CONCAT(se.INFORMATION, '§') AS info 
  FROM Jmdict_Reading_Element AS re LEFT JOIN 
       Jmdict_Sense_Element AS
       se ON re.ENTRY_ID = se.ENTRY_ID
  WHERE re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Reading_Element WHERE READING_ELEMENT = 'example') OR 
        re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Sense_Element WHERE GLOSS = 'example')
   GROUP BY re.ENTRY_ID
  </code></pre>
  
  <p>The slows down when I change</p>
  
  <pre><code>WHERE re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Reading_Element WHERE READING_ELEMENT = 'example') OR 
  re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Sense_Element WHERE GLOSS = 'example')
  </code></pre>
  
  <p>to</p>
  
  <pre><code>WHERE re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Reading_Element WHERE READING_ELEMENT LIKE 'example') OR 
  re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Sense_Element WHERE GLOSS LIKE 'example')
  </code></pre>
  
  <p>I need to do this so that I can use wildcards e.g. </p>
  
  <pre><code>WHERE re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Reading_Element WHERE READING_ELEMENT LIKE 'example%') OR 
  re.ENTRY_ID IN (SELECT ENTRY_ID FROM Jmdict_Sense_Element WHERE GLOSS LIKE 'example%')
  </code></pre>
  
  <p>Here is a link to the database itself:
  <a href="https://www.mediafire.com/file/hyuymc84022gzq7/dictionary.db/file" rel="nofollow noreferrer">https://www.mediafire.com/file/hyuymc84022gzq7/dictionary.db/file</a></p>
  
  <p>Thanks</p>