title: How to design a table need to be queried on every field?
body: <p>Now I met a application requirement to build a database that can be queried for every field. Say, the table is supposed to have 30 fields.</p>
  
  <p>| f1 | f2 | f3 | ...  |f30|</p>
  
  <p>The frontend may needs to query based on multiple or even all fields. For example, need to query all rows with f1 == x AND f2 &lt; y AND f3 > z AND ... AND f30 = abc.</p>
  
  <p>If I create index for each fields, insertion and update operation would be slow. If I just index some fields, query with un-indexed fields would be slow. </p>
  
  <p>I suppose this is a common problem in a lot of application area. Is there any mature solution for this kind of case?</p>