What are the real consequences of using text instead of varchar types in MySQL?

Does anyone have any comparison, personal experience or recommendations on when to use a type textinstead of a large one varcharin MySQL?

While most of the records in my database will be less than 1000 characters, some may take up to 4000 characters or more. What is the maximum length varcharthat makes the textbest option?

I do not need to index these fields.

+3
source share
2 answers

I have no personal experience, but this guy does:

VARCHAR vs. TEXT - some performance numbers

Quick answer: varchar was much faster.

- , . - - varchar (255 ), 255 - char . , .

:

tmp SELECT, - MEMORY, RAM-RAM, , . ( - MyISAM.) TEXT BLOB MEMORY, . ( MEMORY.)

2 - , , .

MyISAM TEXT BLOB 'inline'. ( /table scan), paddies '- I/O. inline blob .

InnoDB 767 TEXT BLOB inline, . , .

- (Maria? Falcon? InnoDB ?) TEXT BLOB . VARCHAR. (, ); VARCHAR (, / ).

+5

, - , , . , . varchar , (cpu/load, memory, disk i/o).

, , .

+1

Source: https://habr.com/ru/post/1727559/


All Articles