Ruby on rails active-record generated SQL on Postgres

偶尔善良 提交于 2020-01-06 06:07:53

问题


Why does Ruby on rails generated more queries in the background on Postgres than MySQL? I haven't tried deploying Rails on production with Postgres yet, but I am just afraid this generated queries would affect the performance. Do you find Rails with Postgres is slower than MySQL, knowing that it produce more query on the background? Or it is relatively the same?


回答1:


i don't think that Postgres will affect your performance, despite it uses more resource, since its a full RDBM implementation, in the long term, postgres will be the best option if you are looking for performance.

Number of SQL queries is relative, you must remember that to bring same results (MySQL and PostGRES has their own implementations) Just to give an example MYSQL dont implement the full PS/SQL..

so in the bottom line: the number of "queries" are irrelevant and postgres will help you to sleep better at night :-)

good reference about this subject: http://www.amazon.com/Enterprise-Rails-Dan-Chak/dp/0596515200



来源:https://stackoverflow.com/questions/2797107/ruby-on-rails-active-record-generated-sql-on-postgres

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!