AdvancedCustomFields / AdvancedCustomFields/acf
Ajax search on Select2 and Relationship fields not optimal (Pro and Free)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
The Ajax calls on the relationship fields used for search is doing a search on every keypress when typing, this results in a call to the database on every key press, this also results in a query with 3 LIKES which is not optimal.
When you have a site with 100k posts this call destroys your database performance especially on an RDS or any cloud DB.
Changing this to only search after the 3rd letter or with a timeout will ease the problem. or even having a search submit after the user has entered the term would probably be better.
N.B. I advise anyone to not use these two fields on a big site until the issue has been resolved, or create your own custom field for ACF to fix these issues.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the Ajax search calls for Select2 and Relationship fields and inspect the generated database queries; done should mean searches no longer query on every keypress and avoid the costly three-LIKE query for large sites.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, databases, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100