Are mysql column data types important to maintain efficiency?

Do I need to carefully select the mysql database column data type, or can I configure things on varchar (99999) without size limit without sacrificing performance?

thank:)

+3
source share
5 answers

Undoubtedly, for non-trivial databases, data types are very important .

For mysql functions (such as time, string or aggregate functions), it is important to choose the right data types.

For schema functionality (such as attachments), it is important to select the correct data types.

For performance, each byte of each field is counted.

.

DBA - .:)

+2

, , . , , . , , .

, VARCHAR , , CHAR , , . VARCHAR , , , , .

, VARCHAR, , MySQL 1000 . , VARCHAR (100), .

( VARCHAR (99999) MySQL - VARCHAR 255, VARCHAR .)

+3

, . , , , , , . , , "Asd $% * @)", ?

, , , , , , .

+3

Depends on what you want to do. For sorting, you want integers to be stored as integers, I would say: For small databases, although you probably won't suffer too much from making everything a cook.

+2
source

You can also use select * from your_table procedure analyse(2, 5)(adjust numbers for your convenience) to have an idea of ​​how MySQL thinks your tables should be.

+2
source

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


All Articles