[Vmail-discuss] Separate domain_alias table?

Paul Makepeace Paul.Makepeace at realprogrammers.com
Thu, 10 Jul 2003 17:28:41 +0100


Hi,

CREATE TABLE domain_alias (
  domain_name varchar(255) DEFAULT '' NOT NULL, # domain to redirect to
  alias varchar(255) DEFAULT '' NOT NULL,       # alias for 'real' domain
  PRIMARY KEY (alias)
);

I was wondering whether there was a reason to have a separate table
versus including it in the domains table?

I'm asking since I'm creating something similar-but-different and the
extra work of normalizing doesn't seem to me to buy anything, at least
that I've spotted :-)

Pros: only requires a single update, no "check if exists, insert if
necessary", or additional selects (modulo left joins/unions).
Cons: can't map one domain to many. Semantically this isn't possible
though, right?

Cheers, Paul

-- 
Paul Makepeace ....................................... http://paulm.com/

"What is Mr Oh's mission? A cow, a racehorse, and me."
   -- http://paulm.com/toys/surrealism/