Advanced Search - Prevent duplicates from prev/next cache affecting pager#36215
Merged
Conversation
…g results Fixes dev/core#6638 The query uses a lot of LEFT joins which cause duplicate contact ids to be inserted into the prevNext cache. This ensures unique cids are fetched from the cache so that the duplicates don't mess up the limit and offset.
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
PR commands & links...
|
Contributor
|
Thanks @colemanw - I just tested this revised version and it works for me. |
Member
|
Could the groupby/min have a performance impact on very large installs, ex WMF? |
Member
Author
|
@mlutfy the prev_next_cache table is just a list of ids returned by the search, and this is a simple query to fetch those ids. No joins onto enormous tables, etc. |
Member
Author
|
@eileenmcnaughton volunteered to test this one :) |
Member
Author
|
Well I haven't heard any objections from @eileenmcnaughton so I guess this is merge-ready :) |
Contributor
|
FWIW, I've been running it in production on 150 installs for the last week without any reports of problems. |
Member
|
Thank you @jmcclelland @colemanw ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Technical Details
The query uses a lot of LEFT joins which cause duplicate contact ids to be inserted into the prevNext cache. This ensures unique cids are fetched from the cache so that the duplicates don't mess up the limit and offset.