Привет, это моя структура таблицы
CREATE TABLE IF NOT EXISTS `sms_report` (
`R_id` int(11) NOT NULL auto_increment,
`R_uid` int(11) NOT NULL,
`R_smppid` varchar(100) collate utf8_unicode_ci NOT NULL,
`R_from` varchar(10) collate utf8_unicode_ci NOT NULL,
`R_status` longtext collate utf8_unicode_ci NOT NULL,
`R_message` text collate utf8_unicode_ci NOT NULL,
`R_numbers` longtext collate utf8_unicode_ci NOT NULL,
`R_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`R_timedate` varchar(40) collate utf8_unicode_ci NOT NULL,
`R_show` int(11) NOT NULL default '1',
`oldformat` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`R_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1947722 ;
У меня около 2 миллионов строк, поэтому, когда я обновляю здесь R_status, кажется, что это занимает слишком много времени (R_status равен 1,2,16 или 24). Подскажите как оптимизировать.
R_id
в предложенииWHERE
? или другие колонки? Вы можете опубликовать пример запросаUPDATE
? - person aularon   schedule 03.09.2010