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

NEUSPRT-266: Optimize log viewing for a contact #135

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

shahrukh-compuco
Copy link

Overview

This pr optimizes the code for viewing the change logs for a contact.

Technical Details

Currently during fetching the change log for a contact we also fetch information for modifier contact here once for each row from the log table. This can give timeout errors on big databases as each call to the function getDisplayAndImage results in one query being executed. Even if same modifier changed the one contact multiple times we will have multiple queries for fetching same information for same modifier.

This pr changes the code to store the modifier information in an array and only query the modifier info if its not already available in the array thus results in significantly lesser number of queries for large change logs.

@shahrukh-compuco shahrukh-compuco merged commit 16428c2 into 5.51.3-patches Sep 17, 2024
@shahrukh-compuco shahrukh-compuco deleted the neusprt-266-optimize-log-viewing branch September 17, 2024 09:16
@jamienovick
Copy link

Should we also submit a PR to core for this? @shahrukh-compuco

@shahrukh-compuco
Copy link
Author

Should we also submit a PR to core for this? @shahrukh-compuco

yes it is already done here civicrm#31125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants