Reputation: 9146
I have following queries from rails logs
Called to database
Userdetail Load (0.1ms) SELECT `userdetails`.* FROM `userdetails` WHERE `userdetails`.`user_id` IN (3, 4)
Called to Cache
CACHE (0.0ms) SELECT `userdetails`.* FROM `userdetails` WHERE `userdetails`.`user_id` = 3 LIMIT 1
Unknown
(0.1ms) SELECT COUNT(*) FROM `votes` WHERE `votes`.`voter_id` = 3 AND `votes`.`voter_type` = 'User' AND `votes`.`votable_id` = 5690 AND `votes`.`votable_type` = 'Post'
There is no LOAD or CACHE word indicating the store in type 3
How do I know where this query was performed?
Upvotes: 1
Views: 68
Reputation: 10405
I think it's because you're doing a count. CACHE
would have been written anyway if it was sent to the cache, my guess is that it was performed on the DB.
To verify this, you could try to execute the query several times in a row, the subsequent calls should be marked as CACHE
Upvotes: 1