What is difference between SET and TEXT column types? I know that maximum length of SET column type is 64 elements. If I will use TEXT column type can I avoid this limit?
Asked
Active
Viewed 68 times
2 Answers
2
set
and text
are two completely different things.
A set
allows you to specify which values (up to 64) are allowed in a column, and input values that contain any unique combination of these values. text
, on the other hand, is just a really long string.

Mureinik
- 297,002
- 52
- 306
- 350
-
What is faster for FIND_IN_SET command. Search in numerical SET or search in the numerical TEXT field??? – XTRUST.ORG May 16 '15 at 09:39
-
Depends on the specific data, of course, but as a rule of thumb, using a numerical `SET` should be considerably faster. – Mureinik May 16 '15 at 09:41
1
Yes, you can avoid this limit (64 elements), But TEXT
type has its limits:
Maximum length (TEXT type): 65,535 (216−1) bytes = 64 KiB
For more information about maximum storage sizes types, see there:
TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT maximum storage sizes

Community
- 1
- 1