3 ms·
>Big Surprise... If you query 1000 rows and bind them to the controller things will be slow. Every time I've been involved in a situation where people complain
by drspacemonkey 9y ago
>Big Surprise... If you query 1000 rows and bind them to the controller things will be slow.
Every time I've been involved in a situation where people complained about Rails being slow, this was the problem. It's not the ORM's fault if you're pulling every row from a table and iterating over them to find the record you want. It's not the framework's fault if you're pulling every row from a table to calculate the average value of a column. And it's not the language's fault if you're pulling every model entry into memory and chopping the array by hand to power pagination.
Rails doesn't save you from having to know SQL. No ORM can do that. The best an ORM can do is save you from having to actually write SQL most of the time.