title: MySQL SELECT is very slow because LONGBLOB
body: <p>why or how solve problem on mysql.</p>
  
  <pre><code>table xxx
  -&gt; id primary key
  -&gt; name varchar 255
  -&gt; data longblob
  </code></pre>
  
  <p>when I store to this table 100 files, each 100MB, the table would have 10GB</p>
  
  <p>and then try to select any row... it takes to long</p>
  
  <pre><code>SELECT name FROM xxx WHERE id = 50 LIMIT 1;
  </code></pre>
  
  <p>takes about 8 second</p>
  
  <p>my problem is probably in that, mysql reads whole row before it return <code>name</code>, which is only 255 characters ... so when I want to list names of 100 files, mysql reads 10 GB and return about 2 KB of result.</p>