[thelist] database structure for speedier queries
Joshua Olson
joshua at waetech.com
Fri Nov 30 18:33:38 CST 2007
> -----Original Message-----
> From: Matt Warden
> Sent: Friday, November 30, 2007 6:31 PM
>
> When I finished this list, I would turn around and tell you to forget
> about it and add an dte_archived field (rather than a yes/no bit).
> Null means active, non-null means archived. At any time you could
> implement a batch job that takes (sysdate - dte_archived) > x records
> and moves them to another table or data store, possibly sitting on
> cheaper storage.
All,
Agreed, but be careful of one thing. Some databases don't index NULL values
in a manner that makes querying for NULL vs. non-NULL as fast as it could
be. It's almost certainly better to add a flag AND the date field if you
are generally only interested in whether or not an item is flagged, and not
necessarily when it was flagged.
Joshua
More information about the thelist
mailing list