title: What is the efficient way to retrieve(select) data from database?
body: <p>In my database contain about 2 millions rows. That contains collection of sentences in each rows(Not English language).</p>
  
  <pre><code>    ![Image of database][1]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/trrkU.jpg" alt="enter image description here"></p>
  
  <p>As a example if user give 'abcd' ,that matched with both row 1,3. Therefor both should select.
  Because of that huge time taken to data retrieve. I'm using following code to retrieve data. If any given word match with the database those rows should be select. </p>
  
  <pre><code>        sb.append("SELECT Sentence FROM corpus Where ");
           for(int k=0;k&lt;wordList.size();k++){
               sb.append( " Sentence like '%" + wordList.get(k) + "%' OR ");
           } 
           sb.append(" 1=0");
           rs2 = dbc.sqlExecute(sb.toString());
  </code></pre>
  
  <p>That selection word may be anywhere in the row. That may be front or middle or end. My problem is when user give some word phrase, huge time taken to select matched rows. Is there any proper way to speed my database retrieves? I think indexing may not work because of I'm not searching only the starting point of the rows. That matched words may contain anywhere in the rows. What is the efficient way to do this? Huge time taken to retrieve. Huge problem to me.Can anyone know proper way to do this?</p>