Reputation: 32130
On Heroku DB plans on crane and up, the cache is not 0 bytes.
Does this mean that in these plans if the code has
User.find(10)
for example, then the result of the query would be saved? thus increasing performance for DB queries?
Upvotes: 1
Views: 156
Reputation: 324445
PostgreSQL does not have a query result cache. Unless Heroku has added one to their custom internal PostgreSQL fork (very unlikely), it's likely to be disk cache available to the database for storing the contents of tables and indexes read from disk, so they don't have to be re-read when accessed again. This is a block-level cache, not a query-level or row-level cache.
Lots of RAM for cache makes a huge difference to PostgreSQL performance, especially on setups with poor I/O performance like Amazon EC2.
Some application level tools like the Hibernate ORM and other JPA implementations do maintain a query result cache, or rather an entity cache. I do not know if ActiveRecord does this, but if it does it'll be on the application server side, not the database side.
Upvotes: 3