title: Building a pre-desc row table on My-Sql to make faster searching query
body: <p>I am trying to make more faster searching query on My-Sql database.</p>
  
  <p>I have 800,000 rows in <code>BOOKMARK</code> table.</p>
  
  <p>when I run with this query </p>
  
  <pre><code>SELECT * FROM `BOOKMARK` WHERE `topic` = 'Apple'
  Showing rows 0 - 29 ( 501 total, Query took 0.0008 sec)
  </code></pre>
  
  <p>It's damn fast!</p>
  
  <p>I have total point for each rows and want to find good one first. </p>
  
  <pre><code>SELECT * FROM `BOOKMARK` WHERE `topic` = 'Apple' ORDER BY total DESC
  Showing rows 0 - 29 ( 501 total, Query took 0.4770 sec) [b_total: 9.211558703193814 - 1.19674062055568]
  </code></pre>
  
  <p>It's now 0.5 seconds!!</p>
  
  <p>This is a huge problem for me.</p>
  
  <p>Here are the table information.</p>
  
  <pre><code>* There are 20,000 different topics in this table.
  * total number exist between 0-10
  * The server calculate total points once a day.
  </code></pre>
  
  <p>I was thinking that if the table is ordered by total number for each topics, the search query doesn't have to include 'ORDER BY total DESC'.</p>
  
  <p>It will save a lot of time, if the table check the orders once a day.</p>
  
  <p>Is there a way to make this happen?</p>