简单的数据库方案帮助
我需要为每个数据库行存储多个 4 字母字符串,但 4 字母字符串的数量每次都可能不同。
那么设置一个新表并为每个 4 个字母的字符串添加一个新行以及另一个表中相关行的 id 会更容易吗?
I need to store multiple 4 letters strings for each database row but the amount of 4 letter strings could be different every time.
So would it be easier to setup a new table and add a new row for each 4 letter string with the id of the related row in the other table ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于规范化原因和性能以及以后能够执行高效查询,您可能希望将其存储在相关表中。
如果您没有其他内容要存储在主表中,则只需将它们存储为多行,并通过公共 ID 进行关联。
如果启用全文搜索,您可以将其存储在一条记录中,并且仍然可以有效地进行搜索,但我怀疑您的 4 个字母字符串是自然语言单词,因此它可能也不适合。
For normalisation reasons and performance as well as being able to later perform efficient queries, you would want to store it in a related table.
If there is nothing else you will store in the Main table, then just store them as multiple rows, and relate via a common ID.
You can store it on one record and still search efficiently, if FULLTEXT searching is turned on, but I doubt your 4-letter strings are natural language words, so it may not suit as well.