title: SQL "like query" on varchar column in H2 not using index
body: <p>In our application using a H2 database (version 1.4.196) we have a search on a varchar field doing either "contains" (<code>column like '%searchterm%</code>) or "begins with" (<code>column like 'searchterm%</code>) searches.</p>
  
  <p>The table is quite large (approx. 400,000 entries) and the search turns out to be slow (varying between 3 seconds on my local development computer to 6 to 12 seconds on our customer's machines).</p>
  
  <p>I found out that the column in question was not indexed and added an index. It turned out that the search time did not improve, even when I added an index hint explicitly to the query. <code>explain</code> revealed to me that no index was used in both cases.</p>
  
  <p>From my experience with other database systems (e.g. MSSQL) I know that, at least for "begins with" queries, indexes can be used to improve search peformances.</p>
  
  <p>As I did not find any related documentation for the H2 database my question:</p>
  
  <p><strong>Is it possible to use indexes in <code>like</code> queries in H2?</strong></p>