MYSQL has created a table of such a long length and is built on an open-source program. Is it reasonable to create a table like this? This is too long.

Source: Internet
Author: User
{Code...} What does this KEYverified mean? There are too many fields in this table !!!!! Doesn't it affect performance...
Create table '[# DB_PREFIX #] users' ('uid' int (11) unsigned not null AUTO_INCREMENT COMMENT 'user uid', 'user _ name' varchar (255) default null comment 'username', 'email 'varchar (255) default null comment 'email', 'mobile' varchar (16) default null comment 'user phone ', 'Password' varchar (32) default null comment' user password', 'salt' varchar (16) default null comment' user append obfuscation code ', 'Avatar _ file' varchar (128) default null comment 'profile picture file', 'sex' tinyint (1) default null comment 'gender ', 'birthday' int (10) default null comment 'birthday', 'category' varchar (64) default null comment' province, 'city' varchar (64) default null comment' city ', 'Job _ id' int (10) DEFAULT '0' COMMENT 'occupation id', 'reg _ time' int (10) default null comment 'registration time ', 'reg _ ip' bigint (12) default null comment 'register ip', 'last _ login' int (10) DEFAULT '0' comment' last logon time ', 'Last _ ip' bigint (12) default null comment' last logon ip', 'Online _ time' int (10) DEFAULT '0' comment' online time ', 'Last _ activity' int (10) default null comment' last active time', 'notification _ unread' int (11) not null default '0' comment' unread system notification ', 'inbox _ unread' int (11) not null default '0' comment' unread Short Message ', 'inbox _ rec' tinyint (1) not null default '0' COMMENT '0-everyone can send it to me, 1-People I follow ', 'fans _ count' int (10) not null default '0' COMMENT 'fans number', 'Friend _ count' int (10) not null default '0' COMMENT 'audience number ', 'invite _ count' int (10) not null default '0' comment' invite me to answer the count', 'Question _ count' int (10) not null default '0' comment' question count ', 'answer _ count' int (10) not null default '0' comment' reply qty ', 'topic _ focus_count 'int (10) not null default '0' comment' number of topics of interest', 'invitation _ available' int (10) not null default '0' comment' invitation qty ', 'Group _ id' int (10) DEFAULT '0' comment' user group', 'reputation _ group' int (10) DEFAULT '0' COMMENT 'prestige corresponding group', 'foridden 'tinyint (1) DEFAULT '0' comment' whether the user is prohibited', 'valid _ e-mail 'tinyint (1) DEFAULT '0' COMMENT 'mailbox verification', 'is _ first_login 'tinyint (1) DEFAULT '1' comment' first logon flag ', 'agree _ count' int (10) DEFAULT '0' comment' agrees with the quantity ', 'Thanks _ count' int (10) DEFAULT '0' comment' thanks to the quantity', 'Views _ count' int (10) DEFAULT '0' comment' personal homepage view quantity ', 'reputation' int (10) DEFAULT '0' comment' prestige', 'reputation _ update_time 'int (10) DEFAULT '0' COMMENT 'prestige Update', 'weibo _ visit' tinyint (1) DEFAULT '1' COMMENT 'weibo allows access', 'integral' int (10) DEFAULT '0', 'draft _ count' int (10) default null, 'common _ e-mail 'varchar (255) default null comment 'common mailboxes ', 'url _ token' varchar (32) default null comment 'personalized website', 'url _ token_update 'int (10) DEFAULT '0', 'verified' varchar (32) default null, 'default _ timezone 'varchar (32) default NULL, 'email _ setting' varchar (255) default', 'weixin _ setting' varchar (255) DEFAULT '', 'cent _ topics 'text, primary key ('uid'), KEY 'user _ name' ('user _ name '), KEY 'email '('email'), KEY 'reputation' ('reputation'), KEY 'reputation _ update_time '('reputation _ update_time '), KEY 'group _ id' ('group _ id'), KEY 'agree _ count' ('agree _ count '), KEY 'Thanks _ count' ('Thanks _ count'), KEY 'forbidden '('forbidden'), KEY 'valid _ e-mail '('valid _ mail '), KEY 'last _ Activity' ('Last _ active'), KEY 'integral' ('integral'), KEY 'url _ token' ('url _ token '), KEY 'verified '('verified '))

This KEYverified(verified) What does it mean?
There are too many fields in this table !!!!!
Doesn't it affect performance...

Reply content:
Create table '[# DB_PREFIX #] users' ('uid' int (11) unsigned not null AUTO_INCREMENT COMMENT 'user uid', 'user _ name' varchar (255) default null comment 'username', 'email 'varchar (255) default null comment 'email', 'mobile' varchar (16) default null comment 'user phone ', 'Password' varchar (32) default null comment' user password', 'salt' varchar (16) default null comment' user append obfuscation code ', 'Avatar _ file' varchar (128) default null comment 'profile picture file', 'sex' tinyint (1) default null comment 'gender ', 'birthday' int (10) default null comment 'birthday', 'category' varchar (64) default null comment' province, 'city' varchar (64) default null comment' city ', 'Job _ id' int (10) DEFAULT '0' COMMENT 'occupation id', 'reg _ time' int (10) default null comment 'registration time ', 'reg _ ip' bigint (12) default null comment 'register ip', 'last _ login' int (10) DEFAULT '0' comment' last logon time ', 'Last _ ip' bigint (12) default null comment' last logon ip', 'Online _ time' int (10) DEFAULT '0' comment' online time ', 'Last _ activity' int (10) default null comment' last active time', 'notification _ unread' int (11) not null default '0' comment' unread system notification ', 'inbox _ unread' int (11) not null default '0' comment' unread Short Message ', 'inbox _ rec' tinyint (1) not null default '0' COMMENT '0-everyone can send it to me, 1-People I follow ', 'fans _ count' int (10) not null default '0' COMMENT 'fans number', 'Friend _ count' int (10) not null default '0' COMMENT 'audience number ', 'invite _ count' int (10) not null default '0' comment' invite me to answer the count', 'Question _ count' int (10) not null default '0' comment' question count ', 'answer _ count' int (10) not null default '0' comment' reply qty ', 'topic _ focus_count 'int (10) not null default '0' comment' number of topics of interest', 'invitation _ available' int (10) not null default '0' comment' invitation qty ', 'Group _ id' int (10) DEFAULT '0' comment' user group', 'reputation _ group' int (10) DEFAULT '0' COMMENT 'prestige corresponding group', 'foridden 'tinyint (1) DEFAULT '0' comment' whether the user is prohibited', 'valid _ e-mail 'tinyint (1) DEFAULT '0' COMMENT 'mailbox verification', 'is _ first_login 'tinyint (1) DEFAULT '1' comment' first logon flag ', 'agree _ count' int (10) DEFAULT '0' comment' agrees with the quantity ', 'Thanks _ count' int (10) DEFAULT '0' comment' thanks to the quantity', 'Views _ count' int (10) DEFAULT '0' comment' personal homepage view quantity ', 'reputation' int (10) DEFAULT '0' comment' prestige', 'reputation _ update_time 'int (10) DEFAULT '0' COMMENT 'prestige Update', 'weibo _ visit' tinyint (1) DEFAULT '1' COMMENT 'weibo allows access', 'integral' int (10) DEFAULT '0', 'draft _ count' int (10) default null, 'common _ e-mail 'varchar (255) default null comment 'common mailboxes ', 'url _ token' varchar (32) default null comment 'personalized website', 'url _ token_update 'int (10) DEFAULT '0', 'verified' varchar (32) default null, 'default _ timezone 'varchar (32) default NULL, 'email _ setting' varchar (255) default', 'weixin _ setting' varchar (255) DEFAULT '', 'cent _ topics 'text, primary key ('uid'), KEY 'user _ name' ('user _ name '), KEY 'email '('email'), KEY 'reputation' ('reputation'), KEY 'reputation _ update_time '('reputation _ update_time '), KEY 'group _ id' ('group _ id'), KEY 'agree _ count' ('agree _ count '), KEY 'Thanks _ count' ('Thanks _ count'), KEY 'forbidden '('forbidden'), KEY 'valid _ e-mail '('valid _ mail '), KEY 'last _ Activity' ('Last _ active'), KEY 'integral' ('integral'), KEY 'url _ token' ('url _ token '), KEY 'verified '('verified '))

This KEYverified(verified) What does it mean?
There are too many fields in this table !!!!!
Doesn't it affect performance...

Hmm ~~ I used to perform BI ETL for a bank ~~ For example ~~ A customer information table or legal person information table with-fields is normal ~~ So don't care ~~ As long as you are well-optimized ~~~ All are OK ~~~

MySQL supports 4096 by default and the InnoDB Engine supports 1000.

The length is okay.

This is normal in the industry.
The basic role information of a game system I previously claimed already has over three hundred fields!

In fact, this is a social problem. Later people look at this to be lazy or don't even know how to divide it into another table. Naturally, they keep adding to the future, then it took a long time to get to the point where everyone saw it.

This table can be optimized.

There is room for optimization, but there is no problem at all. It is only used for registration and login.

You can first extract common things, such as user_id, name, password, and so on. For details about other users, the foreign key is connected. Otherwise, the foreign key is connected.

You can put personal information in a table, and a table related to the Q & A platform. However, this is fine.

The design is unreasonable.

What kind of table creation depends on the specific business logic. It is normal for a table to have so many fields.

I think it's normal. verified means verification.

The data type can still be optimized.

They are all single-column indexes, and none of them are ......

Is this unreasonable? You can usually put a table, suchInformation required for LogonPut one, and the other.

There are not many fields, and the key indicates the index.

Multiple tables can be divided according to the function,
As str2code says.

Of course, it's okay to write such a detailed comment.

It's okay to split 5-6 tables. (Categories include logon, personal information, and messages ..)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.