|
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
Navigation:
[Reply to this message]
|