1

From the MySQL manuals I gathered that when there are VARCHAR columns in a myisam table, then the dynamic storage format will be used. However, It wasn't clear to me, if a CHAR column in the dynamic format will be handled like a VARCHAR or if it will still be fixed size (and get the performance benefits associated with that)?

I remember from some database lectures is, that variable length data is generally appended at the end of a row's fixed length data. Part of the fixed length data would be a pointer for each VARCHAR to that data. But maybe myisam doesn't work this way. So my question is: will CHAR use such a pointer or is it stored at a fixed offset so access to it is fast?

Janick Bernet
  • 20,544
  • 2
  • 29
  • 55

1 Answers1

0

It will be fixed to the length that you have declared when you created the table -> MySQL dynamic format

Check this question also MySQL Row Format: Difference between fixed and dynamic?

Community
  • 1
  • 1
Yasen Zhelev
  • 4,045
  • 3
  • 31
  • 56
  • What you mean by fixed? Maybe I don't fully understand the myisam format, but what I remember from some database lectures is, that variable length fields are generally stored using pointers at the end of a row. So the question is: will char use such a pointer or is it stored at a fixed offset? – Janick Bernet Feb 16 '11 at 09:48
  • By fixed mean that for this column there will be a fixed length place reserved. The column has a fixed length and MySQL knows that. If it was a VARCHAR for instance the column in the row will have floating/changable length depending on the content in it. – Yasen Zhelev Feb 16 '11 at 09:56