Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql RubyonRails活动记录在Postgres上生成SQL_Mysql_Ruby On Rails_Postgresql_Activerecord_Performance - Fatal编程技术网

Mysql RubyonRails活动记录在Postgres上生成SQL

Mysql RubyonRails活动记录在Postgres上生成SQL,mysql,ruby-on-rails,postgresql,activerecord,performance,Mysql,Ruby On Rails,Postgresql,Activerecord,Performance,为什么RubyonRails在Postgres后台生成的查询比MySQL多?我还没有尝试在生产环境中使用Postgres部署Rails,但我担心生成的查询会影响性能。您是否发现使用Postgres的Rails比MySQL慢,因为它会在后台生成更多查询?或者它相对来说是一样的?我不认为Postgres会影响你的表现,尽管它使用了更多的资源,因为它是一个完整的RDBM实现,从长远来看,如果你想要表现,Postgres将是最好的选择 SQL查询的数量是相对的,您必须记住,为了得到相同的结果,MySQL

为什么RubyonRails在Postgres后台生成的查询比MySQL多?我还没有尝试在生产环境中使用Postgres部署Rails,但我担心生成的查询会影响性能。您是否发现使用Postgres的Rails比MySQL慢,因为它会在后台生成更多查询?或者它相对来说是一样的?

我不认为Postgres会影响你的表现,尽管它使用了更多的资源,因为它是一个完整的RDBM实现,从长远来看,如果你想要表现,Postgres将是最好的选择

SQL查询的数量是相对的,您必须记住,为了得到相同的结果,MySQL和PostGRES有自己的实现,只是举一个例子,MySQL不实现完整的PS/SQL

总之,查询的数量是无关紧要的,postgres可以帮助你在晚上睡得更好:-

关于此主题的良好参考: