mysql varchar varbinary_mysql varbinary vs varchar
Andomar,
我们使用5.0.5版.所有mysql版本都忽略尾随空格以进行比较.从手册:
All MySQL collations are of type
PADSPACE. This means that all CHAR and
VARCHAR values in MySQL are compared
without regard to any trailing spaces.
This is true for all MySQL versions,
and it makes no difference whether
your version trims trailing spaces
from VARCHAR values before storing
them
此外,mysql认为在索引中有/无尾随空格的文本是重复的:
For those cases where trailing pad
characters are stripped or comparisons
ignore them, if a column has an index
that requires unique values, inserting
into the column values that differ
only in number of trailing pad
characters will result in a
duplicate-key error. For example, if a
table contains ‘a’, an attempt to
store ‘a ‘ causes a duplicate-key
error.
而且,我们绝对需要关键字索引.所以,我想我们有两个选择:varbinary或text.我们将评估“text”的性能,以及varbinary的多字节功能.
总结
以上是生活随笔为你收集整理的mysql varchar varbinary_mysql varbinary vs varchar的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: .NET操作Excel
- 下一篇: SQL SERVER 的SQL语句优化方