I have a mysql insert on update query like so
insert into table (col1, col2, col3) values (1,2,'huge blob with 12524 chars') on duplicate key update col3 = 'huge blob with 12524 chars';
- col1, col2 is a composite key and it has index on it.
- There are a total of 91 records in table
- All other blobs in table have less than 1000 chars
- If I give col3 a small value then this query runs instantly
- If I give a small value in the insert part but large value in the update part it takes 5 seconds to execute
- If I give large value in insert part but small value in second part it dies with a 1 minute timeout.
What could be causing this query to die on execution after being stuck for 1 minute? What should I look at?
What could be causing this query to take so long to execute and dying if blob value is huge?