Let's say I have a lot of products and all of those products have a lot of specifications. These specifications can change at any time (e.g. "colour" could suddenly be available for new products) and some products do not have certain specifications.
- What would be the best way to store this?
- What would be the best way to search through this?
In the end, there will be tens of thousands of products each with dozens of specifications. Adding a column for each specifications feels wrong, so I'm assuming having a separate table for the specifications and then mapping them through a third table is the best way to go.
How would I be able to search through these specifications easily while maintaining performance when the products_specs table grows to millions of records?
Here's the schema and query I came up with: http://sqlfiddle.com/#!9/53f49/3