On Mon, 4 Aug 2003, Nick May wrote:
> I am just curious as to the minimum field size I need to specify in a
> database to hold a legal keitai email address.
> ...
> Nothing crucial hangs on it, I just like to save bytes where I can. (I
> learned on a ZX80 - it's a deeply ingrained habit)
Best if you use a VARCHAR rather than a CHAR field, then. That's
variable length, so you'll always use the minimum amount of storage
necessary. VARCHAR(255) should suffice for any address you're going to
get, and that's the most portable, but longer never hurts. (I use "text"
in PostgreSQL, which allows text of up to a gigabyte or so--the database
uses various tricks to ensure that the really long strings don't hurt
overall performance.)
Also, as a completely irrelevant aside, you might consider optimizing
for minimum programmer time, rather than machine resources, until
you find out you need to do otherwise. It's been my experience that
programmer time is the most expensive and scarce resource on most
projects.
cjs
--
Curt Sampson <cjs_at_cynic.net> +81 90 7737 2974 http://www.NetBSD.org
Don't you know, in this new Dark Age, we're all light. --XTC
Received on Tue Aug 5 04:55:18 2003