TEXT和BLOB区别
A BLOB
is a binary large object that can hold a variable amount of data. The four BLOB
types are TINYBLOB
, BLOB
,MEDIUMBLOB
, and LONGBLOB
. These differ only in the maximum length of the values they can hold. The four TEXT
types are TINYTEXT
, TEXT
, MEDIUMTEXT
, and LONGTEXT
. These correspond to the four BLOB
types and have the same maximum lengths and storage requirements. See Section 11.7, “Data Type Storage Requirements”.
BLOB是二进制大object,可以存储更多的数据。BLOB类型有四种TINYBLOB,BLOB,MEDIUMBLOB和LONGBLOB,每种类型最大长度值不同。
TEXT有四种类型,TINYTEXT,TEXT,MEDIUMTEXT,LONGTEXT类型。
Instances of BLOB
or TEXT
columns in the result of a query that is processed using a temporary table causes the server to use a table on disk rather than in memory because the MEMORY
storage engine does not support those data types (see Section 8.4.4, “How MySQL Uses Internal Temporary Tables”). Use of disk incurs a performance penalty, so include BLOB
or TEXT
columns in the query result only if they are really needed. For example, avoid using SELECT *
, which selects all columns.
BLOB和TEXT在查询的时候会使用临时表,从而引起磁盘操作,因为内存型存储类型不支持TEXT和BLOB类型。
使用磁盘操作会引发性能下降,因此包括BLOB和TEXT列的查询,最好是需要才查询,避免使用SELECT * 操作
【参考资料】
1、http://dev.mysql.com/doc/refman/5.6/en/blob.html
2、http://imysql.com/2014/09/28/mysql-optimization-case-blob-stored-in-innodb-optimization.shtml
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· 软件产品开发中常见的10个问题及处理方法
· Vite CVE-2025-30208 安全漏洞
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(四):结合BotSharp
· MQ 如何保证数据一致性?
2013-10-11 raid卡MegaCli工具使用说明
2013-10-11 Python之上下文管理