Codeignitor - under login / session load MySQL CPU spike and Fatal MySQL Deadlock

Solution 1:

You need some kind of index on id.

If id is unique, it should probably be the PRIMARY KEY.