[thelist] database structure for speedier queries

Matt Warden mwarden at gmail.com
Sat Dec 1 14:44:50 CST 2007


On 12/1/07, Joel D Canfield <joel at streamliine.com> wrote:
> > sounds like adding the archived field and setting it to null
> > or not null is the best solution.
>
> question to the other folks more db-savvy than I - what's the difference
> in current use or future-proofing between using NULL or not, versus
> using 0 or 1?

They have different purposes. If all you will ever care about is
whether (yes/no) something became true or not, then all you need is
0/1. If you might care about when or how something became true, then
you need to store that information as well. In this case, you could
store the date archived rather than a yes/no, and then you know both
(a) whether something is archived (NULL or non-NULL) and (b) when it
was archived. Having this additional information opens up a number of
other possibilities regarding information lifecycle management.

-- 
Matt Warden
Cincinnati, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list