Minase Posted December 8, 2009 Share Posted December 8, 2009 hy there i am programing in php and sql for some time and till now i was thinking everything i was doing was good here is a simple question i often work with register / login forms i was thinking of asking you guys if my users table is designed correctly from my point of view is good,is there any performance "leaks" in it's design? can i structure it in other way for faster results? thank you Table Users { ID (int 20) primary key, auto increment,unique Username (varchar 14), unique E-mail(varchar 100), unique E-mail2(varchar 100), unique RegisterDate(int 10) Status(smallint 1) Lastvisit(int 10) Idle(int 10) } Registerdate,lastvisit and Idle are unix timestamps ,status is the account status like 0 = unactivated ,1 activated,2suspended etc //edit was thinking about int limit at 2.47 billion is the value 20 too high? Quote Link to comment Share on other sites More sharing options...
DEVILofDARKNESS Posted December 8, 2009 Share Posted December 8, 2009 If you expect that 2.47 billion people will visit your site: No you could make this int shorter but it will not affect the speed that much I think And just because I'm curious: What will idle do? Quote Link to comment Share on other sites More sharing options...
JustLikeIcarus Posted December 8, 2009 Share Posted December 8, 2009 The number in the parenthesis for integer type values has no effect on its size. It is only metadata that applications can be allowed to use to determin how to display it. A field of type INT is always 4 bytes in size with a maximum number of 4294967295 (unsigned). Quote Link to comment Share on other sites More sharing options...
Minase Posted December 8, 2009 Author Share Posted December 8, 2009 @devilofdarkness llol no ,i dont expect that and idle as the name says represent when a user did an action like accessing a page etc @justlikeicarus thanks for reply i think this can be marked as solved thanks for reply guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.