Re: field sizes

From: Date: Thu, 09 Aug 2001 08:12:43 +0000
Subject: Re: field sizes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62050@lists.php.net to get a copy of this message
> I am curious about how to best define the size of fields in mysql. Is > there some size that are better used than others? > > For example without thinking about it to much I would tend to size > fields in multiples of 10 - 20, 50, 100, 200 etc... Is this the best > answer? If there are better sizes, they'd be at 4, 8, 16, 32, 64, etc which are more amenable to computers than humans... I don't think it matters, though, for your varchar fields. Even if it did make a difference, it's more important to have fields the right size for the DATA than for the performance. I'm betting you'd have to be talking about MILLIONS of rows before the field size would make a significant performance difference, if every. TIP: The way to worry about performance for any kind of application that is not completely unblazed territory (where *NO* man has gone before) is to: Not worry about it except to follow general rules of thumb that everybody else is following. Then test your app to see if it's fast enough. If it's not, then profile pieces until you find out *WHERE* it's not fast enough for significant chunks of processing time. Fix that part. 90% of your performance is being done in 10% of your code. Optimize that 10%, and you either are done, or you are in very big trouble. Optimizing anything else before that 10% is just a waste of your time and resources. -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#62050) next »