You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using below two gem for our Sinatra Application.
gem 'sinatra' # version (1.4.7)
gem 'sinatra-activerecord' # version(2.0.9)
We are feeling that active record query caching is not working. Please see below log of our application's console.
10.times{ User.first }
D, [2016-07-26T13:58:31.493868 #13885] DEBUG -- : User Load (2.0ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.564411 #13885] DEBUG -- : User Load (3.4ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.569058 #13885] DEBUG -- : User Load (0.6ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.576557 #13885] DEBUG -- : User Load (5.5ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.584894 #13885] DEBUG -- : User Load (3.0ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.588594 #13885] DEBUG -- : User Load (0.9ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.591352 #13885] DEBUG -- : User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.607551 #13885] DEBUG -- : User Load (0.5ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.609229 #13885] DEBUG -- : User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
D, [2016-07-26T13:58:31.612887 #13885] DEBUG -- : User Load (2.6ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 ORDER BY `users`.`id` ASC LIMIT 1
It shouldn't load user record for every time. Any help is appreciated.
Thanks,
Hare
The text was updated successfully, but these errors were encountered:
Hi All,
I am using below two gem for our Sinatra Application.
We are feeling that active record query caching is not working. Please see below log of our application's console.
It shouldn't load user record for every time. Any help is appreciated.
Thanks,
Hare
The text was updated successfully, but these errors were encountered: