MySQL Forums
Forum List  »  Optimizer & Parser

Removing default NULL from table definition
Posted by: Andrey Kondakov
Date: March 11, 2007 09:52AM


I am trying to optimize table structure according to optimization tips in mysql documentation. Currently most of columns in my table use "default NULL" clause. I see that it's not recommended by optimization guide.
Here I'm a little bit confused, since I don't get exactly which value is necessary to use if a column really needs to have default value.

Say, I have int and varchar columns:
serverTime bigint(20) default NULL
serverName varchar(50) default NULL

I wish to get rid of NULL's and change the columns to:
serverTime bigint(20) default 0
serverName varchar(50) default ''

Is it better than having NULL's? Is it that MySQL optimization guide recommends to do?



Options: ReplyQuote

Written By
Removing default NULL from table definition
March 11, 2007 09:52AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.