mysql - how many columns is too many?

前端 未结 5 1616
走了就别回头了
走了就别回头了 2020-11-28 05:40

I\'m setting up a table that might have upwards of 70 columns. I\'m now thinking about splitting it up as some of the data in the columns won\'t be needed every time the tab

5条回答
  •  囚心锁ツ
    2020-11-28 06:14

    That's not a problem unless all attributes belong to the same entity and do not depend on each other. To make life easier you can have one text column with JSON array stored in it. Obviously, if you don't have a problem with getting all the attributes every time. Although this would entirely defeat the purpose of storing it in an RDBMS and would greatly complicate every database transaction. So its not recommended approach to be followed throughout the database.

提交回复
热议问题