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

后端 未结 7 1207
無奈伤痛
無奈伤痛 2020-11-27 09:06

I am implementing a tagging system on my website similar to one stackoverflow uses, my question is - what is the most effective way to store tags so that they may be searche

7条回答
  •  一个人的身影
    2020-11-27 09:31

    Items should have an "ID" field, and Tags should have an "ID" field (Primary Key, Clustered).

    Then make an intermediate table of ItemID/TagID and put the "Perfect Index" on there.

提交回复
热议问题