Answer the question
In order to leave comments, you need to log in
What structure to choose for the database?
Greetings.
The database will store 100 million records. Each product, in addition to other properties, has 5 modifications. Each of the modifications can take values from NULL to 12. I.e. there will be 371293 different unique modifications in total.
+---------+-----+--------+--------+--------+--------+--------+
| товар | ... | мод.1 | мод.2 | мод.3 | мод.4 | мод.5 |
+---------+-----+--------+--------+--------+--------+--------+
| товар 1 | ... | null | null | null | null | 1 |
| товар 2 | ... | null | null | 12 | 12 | 1 |
| товар 3 | ... | null | 1 | 2 | 3 | 4 |
| товар 4 | ... | 5 | 6 | 7 | 8 | 9 |
| товар 5 | ... | null | null | null | null | 1 |
+---------+-----|--------+--------+--------+--------+--------+
Answer the question
In order to leave comments, you need to log in
I didn’t really understand the description, with live examples it would be clearer.
Are all products the same?
That is, conditionally - for all products, modification No. 1 - color, value 1 - red, 2 - blue, etc.?
In this case, we store 5 tablets - reference books with a decoding of the modifier values.
In the products table, we store 5 fields with the values of these modifiers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question