数据库中的多个对象需要用字符串标记(完全是任意的)来标记。一个解决方案是一个典型的多对多一对多关系表示:标记数据库对象(字符串标记)和标记查找
table Customer CustomerId, CustomerName
table Product ProductId, ProductName
table Tags TagId, TagName
table CustomerTags CustomerId, TagId
table ProductTags ProductId, TagId
另一种解决方案是具有代表通过PATH secondary XML index标签,以提高连续查询XML列:
table Customer CustomerId, CustomerName, Tags
table Product ProductId, ProductName, Tags
哪里的标签是这将有标签,如<标签> <标签名称=“标签1”/> < XML列/标签>和路径索引喜欢/标记/标签
第一种解决方案提供了更快的查找,但添加了更多表格。第二种解决方案更慢但更干净。
我是新来的SQL,可能忽略了一些东西,所以任何输入将不胜感激。
标记删除的好处...非常好,谢谢! – kateroh 2011-02-09 22:29:18