We are developing a site for publishing ads similar to Craigslist. There we have an advertisement, a category and its parameters. Options are tied to categories. And the parameters matter. And these values ββdepend on other values. For example, when I select the βBMWβ option, BMW models such as βX6, X5, M3,β etc. should appear.
We tried to solve it in this way.
We have tables
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).
We added string_value and int_value, because when the user performs a search, he can select an int range or a constant value from the list.
The problem is that the join table(Ads_paramvalues_join) will become very large, because it will contain a mapping from each parameter value. This seems to be causing performance issues.
Here we use Hibernate 3, Spring 3 MVC.
We would like to know if there are any other best practices and patterns to solve such a problem in such cases.
source share