Wednesday, March 21, 2012

Number of fields in a table?

My users login from the tbl_users table.

I would like to store all information on them in this table but that amounts to quite a lot of fields (about 50) and some of these will store a lot of HTML text in them.

Is it best to split the table up for performance reasons or will it make little difference?

Thanks,
JBIf thoes are 50 text fields. Then I would prefer to split. I had faced difficulity with it!|||sreedhark thanks,

Actually only 3 fields are text the others are pretty small fields holding phone numbers, addresses etc.

Would you still split?

Is there a way to query the size of field allocation somehow and is there a magic number that is deemed to be too big in performance terms for the web?

Thanks,
JB|||Well, for text field, using of DataLength you can get how much data is stored in it!

3 fields, I am not sure, It's depend on how much data you are storing! If you are not storing not too large chuncks of data, then we can impliment.

Hope it helps!|||I'd still split. I don't know why I'm fond of it. I guess it makes an easier design to split the login info, and the user data. I'm particular to how I design my databases, but it should be ok to leave them all on one table. However, I personally would put the user data on another table, and have a link table for the login/password, and store the last time of login on that table as well as other info on just logins like remote_addr, and session id.

No comments:

Post a Comment