Answer the question
In order to leave comments, you need to log in
Quick filtering of products by multiple properties?
Hello!
Need advice. There is an online store project. There are about 45 thousand products.
Each product has some properties, all products have a different set of properties.
Properties about 150 pcs. A product can contain multiple values for the same property.
There are only about 130 thousand unique property values.
All tables have indexes, I checked the query through explain, all links are made using keys.
When filtering and selecting a large number of properties in the filter, the speed sags, instead of 1-2 seconds, the page is generated at times 8-10 seconds. Maybe someone has come across this and knows how to solve the problem, links are welcome :-)
Maybe someone solved this using search engines like ElasticSearch or Sphinx?
Thanks in advance!
The table relationship is as follows:
Products (45k records):
product_id int,
name varchar(150),
...
Properties (~150 records):
property_id int,
name varchar(100),
...
Properties_Values (~130k records ):
value_id int, property_id int (link to Properties
table ),
value varchar(100),
... Products_Values (~600-650k records):
product_id int (link to Products table ),
value_id int (link to Properties_Values table ),
Answer the question
In order to leave comments, you need to log in
There are many solutions - Sphinx, elastic, PostgreSQL Textsearch, PostgreSQL HStore.
But regular MySQL can easily cope with such a number of records without sagging in speed, the main thing is to optimize the query.
Can you provide an example of the generated request? I will give advice on how to get rid of subsidence, and bring the search time to <500 ms.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question