<small id='lqFHR'></small><noframes id='lqFHR'>

  1. <i id='lqFHR'><tr id='lqFHR'><dt id='lqFHR'><q id='lqFHR'><span id='lqFHR'><b id='lqFHR'><form id='lqFHR'><ins id='lqFHR'></ins><ul id='lqFHR'></ul><sub id='lqFHR'></sub></form><legend id='lqFHR'></legend><bdo id='lqFHR'><pre id='lqFHR'><center id='lqFHR'></center></pre></bdo></b><th id='lqFHR'></th></span></q></dt></tr></i><div id='lqFHR'><tfoot id='lqFHR'></tfoot><dl id='lqFHR'><fieldset id='lqFHR'></fieldset></dl></div>

  2. <legend id='lqFHR'><style id='lqFHR'><dir id='lqFHR'><q id='lqFHR'></q></dir></style></legend>
      <tfoot id='lqFHR'></tfoot>
        <bdo id='lqFHR'></bdo><ul id='lqFHR'></ul>

      MySQL:大 VARCHAR 与文本?

      时间:2023-08-19
      <legend id='5dR8S'><style id='5dR8S'><dir id='5dR8S'><q id='5dR8S'></q></dir></style></legend>
        <tbody id='5dR8S'></tbody>

    1. <small id='5dR8S'></small><noframes id='5dR8S'>

        <i id='5dR8S'><tr id='5dR8S'><dt id='5dR8S'><q id='5dR8S'><span id='5dR8S'><b id='5dR8S'><form id='5dR8S'><ins id='5dR8S'></ins><ul id='5dR8S'></ul><sub id='5dR8S'></sub></form><legend id='5dR8S'></legend><bdo id='5dR8S'><pre id='5dR8S'><center id='5dR8S'></center></pre></bdo></b><th id='5dR8S'></th></span></q></dt></tr></i><div id='5dR8S'><tfoot id='5dR8S'></tfoot><dl id='5dR8S'><fieldset id='5dR8S'></fieldset></dl></div>

            • <bdo id='5dR8S'></bdo><ul id='5dR8S'></ul>
              <tfoot id='5dR8S'></tfoot>
                本文介绍了MySQL:大 VARCHAR 与文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我在 MySQL 中有一个消息表,用于记录用户之间的消息.除了典型的 id 和消息类型(所有整数类型),我需要将实际的消息文本保存为 VARCHAR 或 TEXT.我将前端限制设置为 3000 个字符,这意味着消息将永远不会插入到数据库中超过此长度.

                I've got a messages table in MySQL which records messages between users. Apart from the typical ids and message types (all integer types) I need to save the actual message text as either VARCHAR or 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.

                使用 VARCHAR(3000) 或 TEXT 是否有理由?仅仅编写 VARCHAR(3000) 有点违反直觉.我已经阅读过 Stack Overflow 上的其他类似帖子,但如果能获得特定于此类常见消息存储的视图会很好.

                Is there a rationale for going with either VARCHAR(3000) or TEXT? There's something about just writing VARCHAR(3000) that feels somewhat counter-intuitive. 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.

                推荐答案

                • TEXTBLOB 可以存储在表外,而表只有一个指向实际存储位置的指针.它的存储位置取决于很多因素,例如数据大小、列大小、row_format 和 MySQL 版本.

                  • TEXT and BLOB may by stored off the table with the table just having a pointer to the location of the actual storage. Where it is stored depends on lots of things like data size, columns size, row_format, and MySQL version.

                    VARCHAR 与表内联存储.VARCHAR 在大小合理时更快,权衡更快取决于您的数据和您的硬件,您希望使用您的数据对实际场景进行基准测试.

                    VARCHAR is stored inline with the table. VARCHAR is faster when the size is reasonable, the tradeoff of which would be faster depends upon your data and your hardware, you'd want to benchmark a real-world scenario with your data.

                    这篇关于MySQL:大 VARCHAR 与文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:mysql如何加入两个表? 下一篇:如何启用 MySQL 查询日志?

                相关文章

                最新文章

                <legend id='zf0ir'><style id='zf0ir'><dir id='zf0ir'><q id='zf0ir'></q></dir></style></legend>
              • <i id='zf0ir'><tr id='zf0ir'><dt id='zf0ir'><q id='zf0ir'><span id='zf0ir'><b id='zf0ir'><form id='zf0ir'><ins id='zf0ir'></ins><ul id='zf0ir'></ul><sub id='zf0ir'></sub></form><legend id='zf0ir'></legend><bdo id='zf0ir'><pre id='zf0ir'><center id='zf0ir'></center></pre></bdo></b><th id='zf0ir'></th></span></q></dt></tr></i><div id='zf0ir'><tfoot id='zf0ir'></tfoot><dl id='zf0ir'><fieldset id='zf0ir'></fieldset></dl></div>
                  <tfoot id='zf0ir'></tfoot>
                  • <bdo id='zf0ir'></bdo><ul id='zf0ir'></ul>

                    <small id='zf0ir'></small><noframes id='zf0ir'>