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 case count when getting list of cases so query is executed once instead of three times #13368

Merged
merged 1 commit into from
Dec 29, 2018

Conversation

mattwire
Copy link
Contributor

Overview

Add caching for a case count query that is used on the case dashboard when listing cases.

Before

Cases are counted three times (query is run three times)

After

Cases are counted once (query is run once and then cached value is used).

Technical Details

Each time the function is called the query was executed. We add a static cache in the standard way so the query is only executed once.

Comments

@lcdservices Is this one you could review?

@lcdservices
Copy link
Contributor

@mattwire I've tested and confirmed. I didn't add any debugging code to verify the query was only hit once. I just tested via the interface to confirm that the case list pulled consistently before and after applying the patch.

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

adding merge on pass based on Brian's review

@seamuslee001
Copy link
Contributor

Merging as per the tag

@seamuslee001 seamuslee001 merged commit 30db69d into civicrm:master Dec 29, 2018
@mattwire mattwire deleted the case_cachecount branch March 1, 2019 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants