300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > mysql varchar varbinary_mysql varbinary vs varchar

mysql varchar varbinary_mysql varbinary vs varchar

时间:2023-10-19 02:35:58

相关推荐

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的多字节功能.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。