title: Database Design For Multiple Product Types with variable attributes
body: <p>I have a database containing different product types. Each type contains fields that differ greatly with each other. The first type of product, is classified in three categories. The second type of product, is classified in three categories. But the third and the fourth one, is not classified in anything.</p>
  
  <p>Each product can have any number of different properties.</p>
  
  <p>I am using database model which is basically like below:
  (see the link)
  <a href="https://www.damirsystems.com/static/img/product_model_01.png" rel="noreferrer">https://www.damirsystems.com/static/img/product_model_01.png</a></p>
  
  <p>I have a huge database, containing about 500000 products in product table.</p>
  
  <p>So when I am going to fetch a product from database with all its attributes, or going to search product filtering by attributes, it affects performance badly.</p>
  
  <p>Could anyone help me what will be the tables structure in sql or do some more indexing or any feasible solution for this problem. Because different ecommerce sites are using this kind of database and working fine with huge different types of products.</p>
  
  <hr>
  
  <p>EDIT : The link to the image (on my site) is blocked, so here is the image</p>
  
  <p><a href="https://i.stack.imgur.com/H1FMv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H1FMv.png" alt="enter image description here"></a></p>