Skip to content

speed up search by name#1388

Merged
jchate6 merged 3 commits intoTOMToolkit:devfrom
griffin-h:feature/faster_search
Jan 23, 2026
Merged

speed up search by name#1388
jchate6 merged 3 commits intoTOMToolkit:devfrom
griffin-h:feature/faster_search

Conversation

@griffin-h
Copy link
Contributor

For large target tables, the search by name is currently very slow. The query can be sped up by separating the name and alias queries and avoiding sorting the giant table, by replacing .distinct() and .first() with .union() and .get(). With ~11 million targets, this brings the time down from ~55 seconds to ~5 seconds. I also added a .strip() to remove leading or trailing whitespace (sometimes this gets easily pasted in).

I'm not sure if the comment in the middle of this function is still relevant, but feel free to delete it if not.

@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Jan 23, 2026
@jchate6 jchate6 self-requested a review January 23, 2026 06:48
@jchate6 jchate6 added the User Issue Raised by a user label Jan 23, 2026
@jchate6 jchate6 added this to the Griffin's PRs and Issues milestone Jan 23, 2026
Copy link
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
This code is not really hit anywhere in the base TOM.

Out of curiosity when does this become an issue for you? Do you have a custom search bar that uses this view?

@griffin-h
Copy link
Contributor Author

Out of curiosity when does this become an issue for you? Do you have a custom search bar that uses this view?

Yes we added a search bar to the main page and the navbar, similar to SNEx, to do a fuzzy search by name. Thanks for the quick approval!

@jchate6 jchate6 merged commit 8af9699 into TOMToolkit:dev Jan 23, 2026
12 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Merged (to dev) in TOM Toolkit Jan 23, 2026
@jchate6 jchate6 moved this from Merged (to dev) to Released in TOM Toolkit Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User Issue Raised by a user

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants