Andomar,
We use version 5.0.5. All mysql versions ignore trailing spaces for comparison. From the manual:
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
Moreover mysql considers texts with/without trailing spaces duplicate in indexes:
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.
And, we absolutely need an index on keywords.
So, I guess we have two options: varbinary or text. We shall evaluate the performance of "text", and multibyte functionality for varbinary.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…