title: Improving '% LIKE %' Query on Firebird Database
body: <p><strong>Situation:</strong></p>
  
  <p>I am trying to write a efficient query using "LIKE" statement to look after a piece of text into a column with short texts.</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>Table 'EVENTSGENERAL' : { ID (KEY), GENERATOR_ (FK), DATETIME, COMPUTERNAME, OSLOGIN, DBLOGIN, INFOTYPE, INFO }
  
  Table 'EVENTSGENERATORS' : { ID (KEY), GENERATOR_ (FK), SHORTNAME, LONGNAME }
  
  Table 'EVENTSINFOTYPES'  : { ID (KEY), GENERATOR_ (FK), VERSION_, INFOTYPE, DESCRIPTION }
  </code></pre>
  
  <p>Indexes : <code>EVENTSGENERAL.GENERATOR</code>, <code>EVENTSGENERAL.DATETIME</code>, <code>EVENTSINFOTYPES.INFOTYPE</code>
  All Ascending.</p>
  
  <p><strong>My Query:</strong></p>
  
  <pre><code>SELECT FIRST @first SKIP @skip A.ID,B.LONGNAME,  A.DATETIME, A.COMPUTERNAME,A.OSLOGIN, A.DBLOGIN, C.DESCRIPTION, A.INFO
  FROM EVENTSGENERAL A JOIN EVENTSGENERATORS B ON B.GENERATOR_ = A.GENERATOR_
  JOIN EVENTSINFOTYPES C ON C.GENERATOR_ = A.GENERATOR_ AND C.INFOTYPE = A.INFOTYPE
  WHERE C.DESCRIPTION LIKE '%VALUE%'
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>This query will run on extra large databases. Is there any way i can improve it ?
  I am using a Firebird database.</p>
  
  <p>Thanks in advance.</p>