mysql - 含有单个内容不固定大字段的表如何设计?
ringa_lee
ringa_lee 2017-04-17 15:20:37
0
3
710

现在需要设计实现记录以下信息的数据库表结构。目前使用的是MySQL数据库。
存储信息如下表所示:

字段 字节数 内容
ID 16 记录的唯一ID(一经确定,不再修改)
Name <256 该条记录的名称(一经确定,不再修改)
CraterTime 8 记录创建时间(一经确定,不再修改)
ModifyTime 8 记录的最后修改时间(每次修改记录后更新)
Level 1 该条记录的信息级别(一经确定,不再修改)
ElemCount 4 下面ElemIDs中的元素(ID)个数
ElemIDs 16×ElemCount 包含元素的ID,每一个ID是16字节。

这里比较难确定的就是最后一个字段应该怎么存储的问题。因为这一个字段的内容可能会比较大(ElemCount的取值在100~1000000左右),并且可能需要经常进行修改
谢谢。

ringa_lee
ringa_lee

ringa_lee

reply all(3)
刘奇

text should be fine

Peter_Zhu

What is the business scenario? What is the maximum number of ElemIDs? Can it be determined?

Ty80

LONGTEXT, store JSON or PHP serialization, etc., and use fixed attributes that need to be queried and filtered as fields.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!