I've got a messages table in MySQL which records messages between users.
(我在MySQL中有一个消息表,该表记录了用户之间的消息。)
Apart from the typical ids and message types (all integer types) I need to save the actual message text as either VARCHAR or TEXT. (除了典型的ID和消息类型(所有整数类型)之外,我还需要将实际消息文本另存为VARCHAR或TEXT。)
I'm setting a front-end limit of 3000 characters which means the messages would never be inserted into the db as longer than this. (我将前端限制设置为3000个字符,这意味着消息插入数据库的时间绝不会超过此时间。)
Is there a rationale for going with either VARCHAR(3000) or TEXT?
(是否有理由使用VARCHAR(3000)或TEXT?)
There's something about just writing VARCHAR(3000) that feels somewhat counter-intuitive. (只是编写VARCHAR(3000)有点不合常理。)
I've been through other similar posts on Stack Overflow but would be good to get views specific to this type of common message storing. (我曾经在Stack Overflow上浏览过其他类似的文章,但是最好获得特定于这种常见消息存储类型的视图。)
ask by Tom translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…