[thesite] Community News Category

rudy r937 at interlog.com
Tue Dec 4 10:07:53 CST 2001


> but does it *really* matter if the categoryid of two
> categories is sequential?

obviously not, unless there's some query which does a sort based on
categoryid

the tip harvester might not be operational here on thesite, but this one's
kinda minor anyway --

<tip type="data design">
if you always draw your PKs from a sequence, they will reflect creation
order, so as long as you never assign PKs manually, then the increasing PKs
tell you the order the rows were created in -- a poor man's timestamp, and
in fact if a timestamp is not needed for date calculations or time
durations, the PK sequence is sufficient
</tip>

the only other situation in which the actual PK numbers matter is when you
have to know them, for example to excluded certain categories from the
query which displays articles on the home page -- but since they are
enumerated in a NOT IN list, it doesn't really matter that they aren't
consecutive, and besides, we may have another method to deal with that
problem too

in general the actual PK number should never matter


rudy





More information about the thesite mailing list