Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache sql query results using dogpile/beaker #2353

Closed
joetsoi opened this issue Mar 17, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@joetsoi
Copy link
Contributor

commented Mar 17, 2015

I don't believe we actually cache any of our sql queries, as a result we end up with repeated requests, for example model.User.get() is run when we run check_access anywhere in the templates, so on some pages we end up fetching the user a couple of dozen times.

I haven't had an indepth look, but we have the beaker caching middleware enabled, but as far as I can tell, we don't actually use it anywhere to cache results returned by sqlalchemy. The sqlalchemy docs now recommend using dogpile over beaker I think both were at some point written by the sqlalchemy guys

http://beaker.readthedocs.org/en/latest/configuration.html
http://dogpilecache.readthedocs.org/en/latest/

@joetsoi joetsoi self-assigned this Mar 17, 2015

@rossjones

This comment has been minimized.

Copy link
Collaborator

commented Mar 1, 2016

This is worse than it appears, as we were actively avoiding the local sqlalchemy 'cache'.

For .get() calls this should be fixed by #2824 and #2825 where the ID is passed (because the 'cache' is an identity map on the PK).

@rossjones rossjones closed this Mar 1, 2016

joetsoi added a commit to joetsoi/ckan that referenced this issue Apr 24, 2016

joetsoi added a commit to joetsoi/ckan that referenced this issue Apr 24, 2016

joetsoi added a commit to joetsoi/ckan that referenced this issue Apr 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.