2 ms·
> The advice to use NULL is usually harmful The advice is to set NOT NULL if you think the field can't be null. That's valid, and a matter of encoding the sch
by kbenson 7y ago
> The advice to use NULL is usually harmful
The advice is to set NOT NULL if you think the field can't be null. That's valid, and a matter of encoding the schema to correctly match the data. Same with check values. Keep bad data out of the database wherever you can.
> and constraints are not high-performance
Then turn off constraint checking after you've built your schema and identified them as a performance problem. Don't optimize away your data integrity before you've even determined it's a problem.
If you actually don't care about your schema, just use a text field and throw whatever in it, or use a document store without any strict checking. If you're using SQL, presumably you're using it for a reason, and that's likely so you can take advantage of what it has to offer.
- helloiloveyou 7y agoHey thanks for clarifying it for the other user! I also agree with everything that you're saying, in this and other comments in the thread