S
S
Sergey Pugovkin2020-08-24 14:50:42
MySQL
Sergey Pugovkin, 2020-08-24 14:50:42

How are varchars stored in Innodb?

How are varchars stored in Innodb?
As far as I know, together with the table. But if the field is updated to a longer text (for example, it was 'qwe', but it became 'qwerty'), where is the "surplus" ('rty') written? If, unlike char, the extra space is not reserved (by zeros/spaces), and you can't just "append" 'rty' next to it. It turns out that when updating varchar with different text, the text will be stored in pieces in different parts of the table? Well, with frequent changes in different lengths, do you get something extremely fragmented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-08-24
@Driver86

varchar has a fixed length and space is reserved for it. No difficulty.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question