title: Is filtering a JSON object faster than querying the database through ajax?
body: <p>I'm working on a product page where you have a set of options which will affect the price.
  The main option, which is always there, lets you choose a material. Depending on the material, then, the set of option can change.</p>
  
  <p>On the database I have a table listing the final products with their prices, which is a table of about 2000 rows listing every single product available with the different options.</p>
  
  <p>Something like:</p>
  
  <pre><code>product_id / code / price / size / option / color
  
       1       ABC     20$     1       3        5
       2       DEF     30$     2       4        5
       3       FFF     30$     3       4        5
  </code></pre>
  
  <p>and so on.</p>
  
  <p>The whole thing works with ajax calls, so everytime an option changes, I query the database, look for the product with that set of options and show the price.</p>
  
  <p>Would it make sense in this specific case to get the whole list of products at the beginning (would be a single query, and about 2000 rows), store it in a Javascript object and filter it?</p>
  
  <p>If it's of any importance, I'm using MySql</p>