Reply to Re: NULL fields in table - efficiency question

Your name:

Reply:


Posted by Boris Stumm on 03/05/07 12:34

Hello,

David Smithz wrote:

> I have read it is better to always have all the fields in a table set to
> NOT NULL as this makes it much quicker.

You did not say what DBMS you are using, however I dont think that NOT NULL
will make things faster on any system. If you want speed, use indexes, and
a DBMS with a good query optimizer.

> In one case I have a table where all fields qualify for this accept for
> one which is comments. This will only sometimes be filled.
>
> Am I therefore better off making this field still to be Not NULL and set
> the default value to a single arbitrary character such as "." or is this
> actually making things less efficient.

You should set all fields that must be filled out to NOT NULL, just to
enforce this. And using "." instead of NULL is not really useful. After all,
if there is no comment, NULL would be a wise choice for the field value.


Boris Stumm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация