Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 137619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:08:05+00:00 2026-05-11T07:08:05+00:00

from this post What is the most efficient way to store tags in a

  • 0

from this post What is the most efficient way to store tags in a database?

It was recommended to store tag tables like this.

Table: Item Columns: ItemID, Title, Content  Table: Tag Columns: TagID, Title  Table: ItemTag Columns: ItemID, TagID 

And another SO post said the same thing. Can anyone explain why tags should be stored like this? I am guessing ItemID is some internal val, title is the tag name (c++, sql, noob, etc) content is whatever else data i want to store with my item. why not something like

Table: Item Columns: ItemID, Title, <more data i want>  Table: TagList Columns: ItemID, Title 

title in item being ‘item name’ and tag title being ‘c++’ ‘sql’ ‘noob’ ‘etc’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:08:05+00:00Added an answer on May 11, 2026 at 7:08 am

    There’s nothing wrong with the second design you show, the one with the TagList table, except that it takes more space.

    That is, if you tag 10,000 items with the tag ‘database-design’, then in the two-table design, you have to store that string 10,000 times. If space-efficiency is more important, you could use the three-table design, which would only store the 4-byte integer ID for ‘database-design’ 10,000 times. A savings of 10 * 10,000 bytes.

    Another difference is that in the three-table design, you could have more than one row in the Tag table with the same string, even though they have different integer ID values. So in the ItemTag table, they would appear to be different tags, and you’d never know that they’re actually tagged similarly. Whereas in the two-table design, tags with the same spelling become grouped together implicitly.

    Another point: if you have the need to change the spelling of tags, then in the two-table design you have to update many rows. In the three-table design, you only need to update a single row.

    And finally, if you commonly need a list of unique tags, it’s more speedy to query the Tags table in the three-table design, instead of needing a SELECT DISTINCT tag FROM TagList every time you need the unique list. And the latter only gives you a list of tags in use, not a list of all eligible tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From this post . One obvious problem is scalability/performance. What are the other problems
Taking advice from this post , I purchased a copy of 'The C Programming
After some stupid musings about Klingon languages, that came from this post I began
What prompts my question is this post from Jeff Atwood , and this post
I have this function from a plugin (from a previous post) // This method
I read this post last night, and I noticed it was from 2006. I
This is my first post here and I wanted to get some input from
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
say I have this $result = mysql_query('SELECT views FROM post ORDER BY views ASC');
i have this in my BlogRepository public IQueryable<Subnus.MVC.Data.Model.Post> GetPosts() { var query = from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.