I have a huge (poorly designed) InnoDB table with millions of records. When I query this guy the execution lasts several minutes. How can I ensure that during this time no other operations (queries, inserts or updates) are affected? The last thing I want is for deadlocks or timeouts for others while my query runs.
Here is the actual query..
SELECT html FROM cms_log where class_name ='main_pages' order by date_created desc;
Right now the field 'class_name' is not indexed but that is not something I can change at the moment.
This post suggested using
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
before running my query. But it is a rather old post and it only speaks of locks. Can someone confirm this is the way to go or give a better way to run the most harmless query possible? (also I don't care for dirty and phantom reads, I just don't want to impact other operations).