J
J
JinDevil2015-09-07 12:50:43
PHP
JinDevil, 2015-09-07 12:50:43

What is the best way to organize data for a product filter?

There is a simple table of goods of the form:

ID | Attribute_1 | Attribute_2 | Attribute_3 | Attribute_4

The table has several million records. All fields of type int. The number of attributes is known in advance and does not change often. The search is based on a non-strict comparison, that is, attributes that are less than, greater than, or equal to the specified value can be selected.
The problem is that the sample is unacceptably long. Is it possible to somehow reorganize the data to speed up the selection?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2015-09-07
@R0dger

you can translate it into sphinxSearch, instead of 1-2 seconds there will be hundredths of a second. Well, of course, for starters, indexes.

S
Stalker_RED, 2015-09-07
@Stalker_RED

Have you tried creating indexes? Very simple structure, several million records should "fly".

M
Max, 2015-09-07
@MaxDukov

Make EXPLAIN queries. 99% - indexes are not used or they do not exist at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question