Search code examples
mysqlisolation-level

Setting Isolation level in a database / table


I understand the concept of isolation w.r.t transactions. I want to know whether I can set the default isolation level for the entire database / a particular table in a database.

I want to do this because i understand that increasing the isolation level can impact performance so i want to restrict the change to a few tables in the entire DB.


Solution

  • You can set the transaction isolation level for a session. Or for the server. But not for one table.

    As a workaround, you can set the desired isolation level immediately before you operate on that single table. Just stay aware that you've set the isolation level for your session.

    Docs

    i understand that increasing the isolation level can impact performance

    Have you measured the impact?