What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

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

1 Answer 1

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 .