title: Storing object with params with values in a database and fetch them
body: <p>We are developing an ad-publishing site similar to craigslist. There we have advertisement, category and its params. The params are attached to categories. And the params has values. And those values depend on other values. For ex., when I choose param "BMW" there have to appear BMW models like "X6, X5, M3" etc.</p>
  
  <p>We tried to solve in it this way.</p>
  
  <p>We have tables</p>
  
  <pre><code>Params(id, category_id, parent_id, name)
  ParamValues(id, param_id, is_string, int_value, string_value)
  Ads(id,category_id) and Ads_paramvalues_join(ad_id, param_value_id).
  </code></pre>
  
  <p>We added string_value and int_value, because when the user will make search, he may choose the int range or constant value from list.</p>
  
  <p>The problem is - that the <code>join table(Ads_paramvalues_join)</code> will become very big, because it will contain mapping from each parameter value. Seems it may cause performance issue.</p>
  
  <p>Here we are using Hibernate 3, Spring 3 MVC.</p>
  
  <p>We'd like to know is there any other kind of best practices and patterns to solve such problem in such cases.</p>