Skip to content

Adjust people index query - #2825

Merged
jmilljr24 merged 7 commits into
mainfrom
adjust-people-index-query
Oct 25, 2026
Merged

jmilljr24 merged 7 commits into
mainfrom
adjust-people-index-query

Conversation

@jmilljr24

Copy link
Copy Markdown
Collaborator

Closes [link an issue or remove this line]

What is the goal of this PR and why is this important?

Speed up the people index

How did you approach the change?

The people index was running one 12-table eager_load join with DISTINCT (from .references(:user)), two counts, and a name search that joined users/contact_methods/addresses. Now it preloads instead of the giant join, runs one count, and searches name/email via a joinless scope. The events attendees and staff taggings searches are unchanged.

Phone moves to its own admin-only filter. This could be moved back for a smaller hit but I think for now its fine to break it out of the main search.

Dev numbers (36k people):
before after
default results ~1200s ~150ms
name search count ~200–310ms ~20ms
name search page ~25ms ~6ms
Name search also no longer duplicates rows (was 25 rows / 20 unique; count 329 vs the correct 247).

UI Testing Checklist

Anything else to add?

@jmilljr24
jmilljr24 requested a review from maebeale October 24, 2026 13:25
@maebeale

Copy link
Copy Markdown
Collaborator

would you move phone to far right?
Screenshot 2026-10-24 at 6 46 20 PM

@maebeale maebeale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice results! 🥇

@maebeale

maebeale commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator
Screenshot 2026-10-24 at 9 12 37 PM

one note: we used to be able to use prefixes for searches, and this will remove that. can instead of "phone" at the right it's a contact_info search that does what it used to again?

@jmilljr24

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-10-24 at 9 12 37 PM

one note: we used to be able to use prefixes for searches, and this will remove that. can instead of "phone" at the right it's a contact_info search that does what it used to again?

Sounds good. I thought phone was the intended search as that was the original label. I will add back the contact_info search with SearchCop prefix support.

maebeale added a commit that referenced this pull request Oct 25, 2026
#2825's contact-info box searches through search_contact, so country joins its
attributes and the box's tooltip names it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jmilljr24
jmilljr24 merged commit 074f8f7 into main Oct 25, 2026
3 checks passed
@jmilljr24
jmilljr24 deleted the adjust-people-index-query branch October 25, 2026 08:59
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.

2 participants