-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Queries without a full first name, eg "C Brown" vs "Christopher Brown", are very slow. These two benchmarks are very dependent on the caches state. If I rerun them, then I get the result back immediately (nice!). So for accurate tests, make sure you wait ~15 minutes between executions. Or if you have other ways to skip the cache so for easier benchmarking, then I'm interested to hear that as well.
Christopher Brown
- requests take 4.6sec with a fresh cache
- Web UI URL: https://www.fec.gov/data/receipts/?data_type=processed&contributor_name=Christopher+brown&contributor_city=LONDON&contributor_state=ZZ
- cURL:
time curl 'https://api.open.fec.gov/v1/schedules/schedule_a/?api_key=U4CGxchr88wIKcoCqfL8mxExQearu8iTo6S9f0wU&contributor_name=Christopher+Brown&contributor_city=LONDON&contributor_state=ZZ'
C Brown
- request take 2.6 minutes with a fresh cache
- Web UI URL: https://www.fec.gov/data/receipts/?data_type=processed&contributor_name=C+brown&contributor_city=LONDON&contributor_state=ZZ
- cURL:
time curl 'https://api.open.fec.gov/v1/schedules/schedule_a/?api_key=U4CGxchr88wIKcoCqfL8mxExQearu8iTo6S9f0wU&contributor_name=C+Brown&contributor_city=LONDON&contributor_state=ZZ'
I'm wondering:
- can we improve this? Eg by adding an index on just the first letter of the first name? I think you are using postgres, but not sure. This seems like a pretty common pattern that would be good to optimize
- If we can't improve it, can we at least pin down the exact conditions that cause this so I know what sorts of queries to avoid? eg is it just when there are any single letter tokens in the name?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels