There is a table with announcements of goods washing malishn.
+----+-----------------+----------------+ | id | brand_name | model | +----+-----------------+----------------+ | 1 | brand1 | model1 | | 2 | brand2 | model2 | | 3 | brand3 | model3 | +----+-----------------+----------------+ Each washing machine has its own characteristics: type of loading, presence of drying, weight, color, etc. (about 40-50 for each of the models).
I am doing a filter on the site. I need to choose certain ads of washing machines that have, for example, only black and white color and with the presence of drying.
The question is how to store these characteristics in the database, so that it would be faster to search ?
The first thought that came to mind: there are a lot of characteristics for each ad, you need to serialize an array in PHP and write its table with the ads. And then search for the regular expression by this field.
The second option is to create a second table and write down all the specifications there. When filtering, the main JOIN is the one where the characteristics are stored and for each ad, select based on the characteristics selected by the user.
Tell me, please, how to be, so that the sample from the database was faster and more efficient?
Thank you in advance!