![]() |
Задавайте вопросы, мы ответим
Вы не зашли.
это из документации для версии 5.0
Memory usage. All Cluster table rows are of fixed length. This means (for example) that if a table has one or more VARCHAR fields containing only relatively small values, more memory and disk space is required when using the NDB storage engine than would be the case for the same table and data using the MyISAM engine. (In other words, in the case of a VARCHAR column, the column requires the same amount of storage as a CHAR column of the same size.)
значит в 5.1 этого ограничения уже нет и varchar в памяти имеет фактическую длину ?
Неактивен

Да, это так. Более того, 5.1 при хранении данных в памяти поддерживает TEXT и BLOB типы. Поля типа TEXT и BLOB занимают 256 байт в строке таблицы - остальное в отдельной области.
mysql> select VERSION();
+-----------------+
| VERSION() |
+-----------------+
| 5.1.20-beta-log |
+-----------------+
1 row in set (0.00 sec)
mysql> show create table r\G
*************************** 1. row ***************************
Table: r
Create Table: CREATE TABLE `r` (
`i` int(11) NOT NULL,
`t` text,
`tc` varchar(255) DEFAULT NULL,
PRIMARY KEY (`i`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> show table status like 'r'\G
*************************** 1. row ***************************
Name: r
Engine: NDBCLUSTER
Version: 10
Row_format: Dynamic
Rows: 2
Avg_row_length: 296
Data_length: 393216
Max_data_length: 0
Index_length: 0
Data_free: 0
Auto_increment: NULL
Create_time: NULL
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment: number_of_replicas: 2
1 row in set (0.00 sec)Неактивен