SQLinfo.ru - Все о MySQL

Форум пользователей MySQL

Задавайте вопросы, мы ответим

Вы не зашли.

#1 25.10.2007 20:09:09

Golova
Завсегдатай
Зарегистрирован: 23.03.2007
Сообщений: 92

varchar и cluster NDB engine

это из документации для версии 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 в памяти имеет фактическую длину ?

Неактивен

 

#2 25.10.2007 21:21:58

rgbeast
Администратор
MySQL Authorized Developer and DBA
Откуда: Москва
Зарегистрирован: 21.01.2007
Сообщений: 3878

Re: varchar и cluster NDB engine

Да, это так. Более того, 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)

Неактивен

 

Board footer

Работает на PunBB
© Copyright 2002–2008 Rickard Andersson