Does PostgreSQL run some performance optimizations for read-only transactions

前端 未结 2 401
猫巷女王i
猫巷女王i 2021-02-07 02:19

According to the reference documentation the READ ONLY transaction flag is useful other than allowing DEFERRABLE transactions?

SET SESSION CHARACTERISTICS AS TRA         


        
2条回答
  •  猫巷女王i
    2021-02-07 02:50

    To sum up the comments from Nick Barnes and Craig Ringer in the question comments:

    1. The READ_ONLY flag does not necessarily provide any optimization
    2. The main benefit of setting the READ_ONLY flag is to ensure that no tuple is going to be modified

提交回复
热议问题