A
A
Adelina Turcan2019-01-03 09:31:01
MySQL
Adelina Turcan, 2019-01-03 09:31:01

How does MySQL save data?

The question is how MySQL takes up disk space, and the correct choice of data type.
For example, let's assume that there are a million articles that have a title and a description.

title: VARCHAR(250)
content: TEXT

From these articles:
  • 30% have text less than 1000 characters
  • 30% over 1000 and under 5000
  • the rest are over 5000

If you make 3 tables, and in each specify content equal to the desired length, MySQL will take up less disk space?
So MySQL reserves the "maximum" space for each row? Or does it take up space only for the data that it currently has?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2019-01-03
@adelina_turcan

If you make 3 tables of the same type instead of one, you can one day end up in a fool. It's not worth the risk. The TEXT
data types were invented to save us.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question