Does setting .readonly in queries improve performance?
I am displaying records that will not be updated, so I think it makes sense to mark开发者_如何学Go my queries as readonly.
Will this improve performance?
No, marking the records as readonly is completely useless in this case and will possibly degrade performance because Rails would have to set the readonly flag on each of the objects returned rather than skipping that.
精彩评论