Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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?

share|improve this question
up vote 2 down vote accepted

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)

share|improve this answer
thank you. Is this to say that in the real schema, badges are stored as ids and not text? – Mohamad Feb 23 '11 at 6:28
@Mohamad ... correct – waffles Feb 23 '11 at 6:38

You must log in to answer this question.

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