2014-11-01 渋谷Ruby会議01 http://regional.rubykaigi.org/shibuya01/Read less
![すこやかRails](https://cdn-ak-scissors.b.st-hatena.com/image/square/b61a1b6a5f54a098337873ee32f237e9d0809fc2/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fsukoyakarails-141103224605-conversion-gate01-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)
Ruby expressionslast modified October 18, 2023 In this part of the Ruby tutorial, we cover expressions. Expressions are constructed from operands and operators. The operators of an expression indicate which operations to apply to the operands. The order of evaluation of operators in an expression is determined by the precedence and associativity of the operators. An operator is a special symbol wh
rails (3.2.3) activerecord (3.2.3) mysql2 (0.3.11) ちょっと遡って話をしたほうがいいのかも。 前提:Mysql(InnoDB)でcount(1)はテーブルスキャンが発生して遅い 非力なインスタンスを使っていたので、 数十万件ってレベルからこれがボトルネックになっていた。 そのために、Railsが装備しているcounter_cacheという機能を使う。 ただ、counter_cacheってのは関連するモデルの件数を覚えておくっていう方法で、 テーブルの全レコードの数を保存しておく方法ではない。 それをしたいなら別の実装を。 参考:A Guide to Active Record Associations counter cahceってなんだ 繰り返しになるけど、関連するモデルの件数を覚えておく。 class Order < ActiveRec
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く