MySQL TEXT或VARCHAR [英] MySQL TEXT or VARCHAR

查看:77
本文介绍了MySQL TEXT或VARCHAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个非常大的历史表,其中包含一列,该列最多包含500个UTF8字符,并且磁盘空间增长得非常快!

We have a very large historical table that contains a column with at most 500 UTF8 characters, and the disk space grows really fast!

我们每天至少要有200万行...而且我们想知道哪种方法更好(主要是在存储方面,但在性能方面)? TEXT还是VARCHAR(512)?

We're having at least 2 million rows a day... and we were wondering which would do a better job (mostly in storage but in performance as well)? TEXT or VARCHAR(512)?

推荐答案

VARCHAR在您的情况下可能更可取.查看此经常重新发布的文章.

VARCHAR is probably preferable in your case from both the storage and performance perspective. View this oft-reposted article.

这篇关于MySQL TEXT或VARCHAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆