conumdrum

Here is the statements, I am locked into using MYISAM because of server constraints and fulltext searching.

UPDATE categories SET left_id = left_id +2, right_id = right_id +2 WHERE left_id >168232
UPDATE categories SET right_id = right_id +2 WHERE 168199 BETWEEN left_id AND right_id

These two queries take about 40 seconds each. I tried…

ALTER TABLE categories DISABLE KEYS
UPDATE categories SET left_id = left_id +2, right_id = right_id +2 WHERE left_id >168232
UPDATE categories SET right_id = right_id +2 WHERE 168199 BETWEEN left_id AND right_id
ALTER TABLE categories ENABLE KEYS

but that didn’t save that much, I think it needs the keys to select. Is there a more efficient way to do this, it seems to me it should be an easy operation to do a math function on a column. Maybe not. Thanks to anyone who can help