A
A
Alexander Mikhailenko2017-11-01 18:11:33
MySQL
Alexander Mikhailenko, 2017-11-01 18:11:33

Serialized array vs 25 columns in a table?

Tell me please.
There are 25 entity properties (always 25 but may have different values). What would be better from the database point of view, to create 25 fields or one field in which to store the serialized array?
The data will be needed often, in addition, I will be used in case of a misspelling as well.
Advise, there is no strong experience in design in this regard.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2017-11-01
@m1hasik

Each field in a separate column during the selection will work much faster, especially if you also build indexes on the selected fields.
If indexes are not needed, then you can use the JSON field type, then you can even make a selection by a specific property, and if necessary, it's easy to add a few more properties without creating additional fields.

R
RidgeA, 2017-11-01
@RidgeA

Each property is a separate column.
This will allow you to select only the properties you need, if everything is not needed and search by properties.

A
Anton, 2017-11-01
Reytarovsky @Antonchik

If you want to use these properties for database selections, create separate columns, otherwise write in one column

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question