I've got a huge table that looks like this:
CREATE TABLE `images` (
`image_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`data` mediumblob,
PRIMARY KEY (`user_id`,`image_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
on which I have to run a query which compresses the blob field. Will MySQL be able to use index with the following query:
UPDATE images SET data = COMPRESS(data) WHERE (user_id = ? AND image_id = ?) OR (user_id = ? AND image_id = ?) OR (...) OR (...);
I have to do it like this since there's no way I can update the whole table in a single query and I can't update by only using user_id
.
EDIT: explain
and update
doesn't work, you guys know that, right?