MySQL: optimize a table with lots of columns

My user table has more than 26 columns, is this normal? DB is already normalized to level 3, when this table used my opinion. Is there 26 columns in order or is there some other optimization method that you use when developing your db that I have to do?

Optional: What did splitting the table mean?

+4
source share
1 answer

There is nothing wrong with 26 columns, but if they are rarely used, then they are different.

instead of 26 columns, you take the one you use less and group them using the serialization string.

change the field to a text field, and then in your code you can de-serialize them and use them. if you need to update, you update the array (from your code) and then serialize it and save it in the database.

+4
source

Source: https://habr.com/ru/post/1383098/


All Articles