ชนิด ข้อมูล ขนาด ที่เก็บลงฐานข้อมูล msql ซึ่งสามารถกำหนดขนาดให้เหมาะสม
ได้กับกับความจำเป็นในการเก็บข้อมูล ลงฐานข้อมูลเพื่อประสิทธิภาพ ในการจัดเก็บ
Storage Requirements for Numeric Types
| Data Type | Storage Required |
TINYINT |
1 byte |
SMALLINT |
2 bytes |
MEDIUMINT |
3 bytes |
INT, INTEGER |
4 bytes |
BIGINT |
8 bytes |
FLOAT( |
4 bytes if 0 <= p <= 24, 8 bytes if 25 <= p <= 53 |
FLOAT |
4 bytes |
DOUBLE [PRECISION], REAL |
8 bytes |
DECIMAL(, NUMERIC( |
Varies; see following discussion |
BIT( |
approximately (M+7)/8 bytes |
Storage Requirements for Date and Time Types
| Data Type | Storage Required |
DATE |
3 bytes |
TIME |
3 bytes |
DATETIME |
8 bytes |
TIMESTAMP |
4 bytes |
YEAR |
1 byte |
Storage Requirements for String Types
In the following table, M represents the declared column length in characters for non-binary string types and bytes for binary string types. L represents the actual length in bytes of a given string value.
| Data Type | Storage Required |
CHAR( |
M × w bytes, 0 <= 255, where w is the number of bytes required for the maximum-length character in the character set |
BINARY( |
M bytes, 0 <= 255 |
VARCHAR(, VARBINARY( |
L + 1 bytes if column values require 0 – 255 bytes, L + 2 bytes if values may require more than 255 bytes |
TINYBLOB, TINYTEXT |
L + 1 bytes, where L < 28 |
BLOB, TEXT |
L + 2 bytes, where L < 216 |
MEDIUMBLOB, MEDIUMTEXT |
L + 3 bytes, where L < 224 |
LONGBLOB, LONGTEXT |
L + 4 bytes, where L < 232 |
ENUM(' |
1 or 2 bytes, depending on the number of enumeration values (65,535 values maximum) |
SET(' |
1, 2, 3, 4, or 8 bytes, depending on the number of set members (64 members maximum) |
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
ข้อกำหนดในการเผยแพร่บทความ ข่าวสาร
** บทความนี้มีลิขสิทธิ์ ไม่อนุญาติให้คัดลอก ทำซ้ำ ดัดแปลงก่อนได้รับอนุญาต **
โปรดระบุแหล่งที่มา บริษัท เอ็กซ์ตร้า คอร์ปอเรชั่น จำกัด / https://www.ireallyhost.com
** บทความนี้มีลิขสิทธิ์ ไม่อนุญาติให้คัดลอก ทำซ้ำ ดัดแปลงก่อนได้รับอนุญาต **
โปรดระบุแหล่งที่มา บริษัท เอ็กซ์ตร้า คอร์ปอเรชั่น จำกัด / https://www.ireallyhost.com
ทั่วไป






