Rails 日志有很多 CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1

kikyous · 发布于 2015年06月02日 · 1106 次阅读
2564

生产模式的日志几乎每个请求都有很多

CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1

但是开发模式就没有,不知道这个sql是怎么来的?

posts`.`product_id` = 22  ORDER BY created_at DESC, created_at desc LIMIT 5
D, [2015-06-02T09:04:39.199689 #7335] DEBUG -- :   User Load (0.3ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` IN (9, 39, 3)
D, [2015-06-02T09:04:39.202130 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.202367 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.9ms)
D, [2015-06-02T09:04:39.203560 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.203820 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.7ms)
D, [2015-06-02T09:04:39.205271 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.205531 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.8ms)
D, [2015-06-02T09:04:39.207546 #7335] DEBUG -- :   News Load (0.7ms)  SELECT  `posts`.* FROM `posts` WHERE `posts`.`deleted_at` IS NULL AND `posts`.`type` IN ('News') AND `posts`.`product_id` = 22  ORDER BY created_at DESC, created_at desc LIMIT 5
D, [2015-06-02T09:04:39.209072 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` IN (52)
D, [2015-06-02T09:04:39.210770 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.211000 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.7ms)
D, [2015-06-02T09:04:39.212172 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.212389 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.6ms)
D, [2015-06-02T09:04:39.213514 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.213752 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.6ms)
D, [2015-06-02T09:04:39.215050 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.215276 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.6ms)
D, [2015-06-02T09:04:39.216479 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
I, [2015-06-02T09:04:39.216708 #7335]  INFO -- :   Rendered shared/_star.html.erb (0.6ms)
D, [2015-06-02T09:04:39.218603 #7335] DEBUG -- :   Ask Load (0.8ms)  SELECT  `posts`.* FROM `posts` WHERE `posts`.`deleted_at` IS NULL AND `posts`.`type` IN ('Ask') AND `posts`.`comments_count` = 0  ORDER BY created_at DESC, created_at desc LIMIT 5
D, [2015-06-02T09:04:39.220495 #7335] DEBUG -- :   User Load (0.3ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` IN (22, 21, 52)
D, [2015-06-02T09:04:39.222352 #7335] DEBUG -- :   CACHE (0.0ms)  SELECT  `users`.* FROM `users` WHERE `users`.`remember_token` IS NULL LIMIT 1
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册