4

I would expect that user badges would be stored with a schema similar to this:

UserBadges(@id, @userId, @badgeId, @creationDate)

Instead, according to this explanation and the datadump, there is no badgeId column; rather there exists a column where the badge name is stored as a string of text.

This may be for performance reasons, to minimize joins, for example. But such a schema has a substantially greater memory footprint than one that stores a badgeId. Is this a case of choosing the lesser of two evils?

Post tags are handled differently, and I would like to know why. Each post tag is stored as an individual record with a postId and tagId columns in a PostsTags table, without an id column. Getting the tag name in this case would require a join, unless you grab it from the post.

Why does it make sense to apply one strategy for badges and quite another for tags? Can anyone elaborate on this?

1 Answer 1

2

The data dump schema does not match the schema with use internally.

The choice was made not to export the badges table in the data dump and breaking 3nf here simplifies consumption of the data (one less table to import)

2
  • thank you. Is this to say that in the real schema, badges are stored as ids and not text?
    – Mohamad
    Commented Feb 23, 2011 at 6:28
  • @Mohamad ... correct
    – waffles
    Commented Feb 23, 2011 at 6:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .