|
Posted by Erland Sommarskog on 03/14/06 00:40
David Portas (REMOVE_BEFORE_REPLYING_dportas@acm.org) writes:
> Now here is a more interesting slant on the key problem. When does a
> metric become a kludge?
When the kludge is not a metric.
Of course, two hits from the same IP address in the same ms is a little
funny - but so are two hits 10 ms apart, but your model does not account
for that. No_of_hits is just a mechanism you've added to solve the
problem with collisions on a key values that represents a contiguous
spectrum.
Take another example. Some process in laboratory or whereever generates
lots of measurements data, in rates of microseconds. We don't use datetime
to store the value, obviously, but would it be right to assume discrete
steps of microseconds? Maybe, but what if the frequency is somewhat
uneven?. We can get two values registered for the same millisecond, but
we know that they are nevertheless apart. And here we are not talking
number of hits, but some value - presumably floating-point.
What I am saying is that you cannot use en entity that is a continuous
spectrum as a key. Key values must be discrete. Of, course, in a
digital computer, everything is discrete - but that only means that
two analogue values can get the same representation.
And this is just one example where the real world does not have that
fine key the relational model wants. Again, think customers.
> You seen to suggest that performance should be the deciding factor.
Not really, as you can see above. However, for registering hits on a
busy web site, performance is probably argument enough to kill that
model.
> On the other hand it does a lot of harm to perpetuate the transparently
> silly idea that "There isn't a natural key".
It isn't silly. It's fact of life that in many cases. Common cases.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|