Ruby on Rails的活跃记录生成的SQL上的Postgres [英] Ruby on rails active-record generated SQL on Postgres

查看:258
本文介绍了Ruby on Rails的活跃记录生成的SQL上的Postgres的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么轨道上的Ruby产生在Postgres的背景比MySQL更多的疑问?我没有尝试过生产与Postgres的部署Rails的呢,但我只是怕这个生成的查询会影响性能。你有没有发现钢轨的Postgres比MySQL的慢,因为知道它产生更多的查询上的背景是什么?或者是比较相同的?

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?

推荐答案

我不认为Postgres将影响你的表现,尽管它使用更多的资源,因为它的一个完整的RDBM实施,从长远来看,Postgres将是最好的选择,如果你正在寻找的性能。

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.

SQL查询的数量是相对的,你必须记住,带来同样的结果(MySQL和Postgres有自己的实现)只是举一个例子MYSQL不实现完整的PS / SQL。

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..

所以在底线:查询的数量是无关的,Postgres将帮助你在晚上睡得更好: - )

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

关于这个主题很好的参考: http://www.amazon.com/Enterprise-Rails-丹泽/ DP / 0596515200

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

这篇关于Ruby on Rails的活跃记录生成的SQL上的Postgres的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆