How to disable prepared statement in heroku with postgres database

后端 未结 6 1183
-上瘾入骨i
-上瘾入骨i 2021-02-20 12:13

I fixed an issue on my rails project locally (with postgres config) while adding in database.yml this statement:

test:
  prepared_statements: false
6条回答
  •  醉话见心
    2021-02-20 12:31

    turning off prepared statements decreases performance because postgresql has to replan every query before executing so i do not suggest to turn it off for production servers - especially as rails is notorious for doing many small queries when you don't take really good care about eager loading everything. I suggest indead figuring out how to do restarts in live after each deployment without affecting the availability of your service. I am not a rails guru but i know that it's doable (our company does it exactly like that). Here is a bit more insight into why this is happening https://github.com/rails/rails/issues/12330

提交回复
热议问题