Home > database >  Mysql table design problems
Mysql table design problems

Time:09-24

The user information in the native (including provinces, cities and counties), now is entangled with
1. I was in the design of user information table of a county is the only design field, then call him from the area table parent_id access to provinces and cities
2. Simple and crude in the user information table to build province, city, county three fields
From the Angle of reasonable performance or MySQL database design, which is more appropriate, forget each elder glad, thank you very much,

CodePudding user response:

If I were to design I will choose the first one: will take into account the data redundancy of these; But if he will choose the second is my colleague to design, simple implementation, also need not to do when doing query associated query, can be directly removed them from the table,

CodePudding user response:

Sometimes the appropriate redundancy can get quick query

CodePudding user response:

The second, not a space again, be afraid of anything
  • Related