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(chǎn)’, an attempt to
store ‘a(chǎn) ‘ causes a duplicate-key
error.
而且,我們絕對需要關(guān)鍵字索引.所以,我想我們有兩個選擇:varbinary或text.我們將評估“text”的性能,以及varbinary的多字節(jié)功能.
總結(jié)
以上是生活随笔為你收集整理的mysql varchar varbinary_mysql varbinary vs varchar的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: .NET操作Excel
- 下一篇: 探索云计算、大数据的特色化应用之路