On Mon, Jul 29, 2002 at 06:05:02PM -0400, Keith C. Ivey wrote: > On 28 Jul 2002, at 17:56, Paul DuBois wrote: > > At 14:34 -0700 7/28/02, Charlie wrote: > > >Is there any storage / performance penalty for specifying '' or 0 as > > >default values, as opposed to allowing null's in the table structure? > > > > NULL values take less storage space. (One bit per NULL value in a > > row, if I remember correctly). > > But '' and 0 values also take only one bit of storage space, > according to > > http://www.mysql.com/doc/D/y/Dynamic_format.html > > And if you don't have any nullable columns in your table, no bytes > will be needed for the NULL bits, so it appears that having NULL > values actually takes slightly *more* space.
My understanding is that if you mark a column as NOT NULL then MySQL only needs as much space as you'd expect to store the data. However, if the column may contain NULLs, then MySQL marks null values with a special bit in the record header. Jeremy -- Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo! <[EMAIL PROTECTED]> | http://jeremy.zawodny.com/ MySQL 3.23.51: up 61 days, processed 1,269,328,636 queries (240/sec. avg) --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php