Re: does a table always need a PK?
Date: Sat, 23 Aug 2003 18:28:07 +0100
Message-ID: <MPG.19b1b482826a20ab989723_at_news1.eircom.net>
> You almost certainly should have a UNIQUE primary key on every relation.
Maybe this true in theory, but not essential in practice?
I'm not being facetious here.
Take an example that I recently worked on - we have a lookup table of 26
counties (in Ireland) which really has a very small about of data in it,
say max. 1.5K.
Now, as I understand it, RDBMS's will look at the size of a table before
scanning it to see if it's worthwhile using an index, and if the table
is too small, it'll just perform a straigh scan anyway and not bother
with the index, even if you've gone to the trouble of putting one in.
AFAIK, this is true for the RDBMS's that I use (Interbase, FireBird and PostgreSQL).
Any thoughts, rants, references, URLs on this topic welcomed.
Paul...
-- plinehan__AT__yahoo__DOT__com C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04 p.s. just lacerated a tendon in left hand, so pls excuse typos and tricky abbrevs - TIA.Received on Sat Aug 23 2003 - 19:28:07 CEST