Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch lookup queries using the search endpoint with ID fields #78

Open
exogen opened this issue Aug 23, 2018 · 0 comments
Open

Batch lookup queries using the search endpoint with ID fields #78

exogen opened this issue Aug 23, 2018 · 0 comments

Comments

@exogen
Copy link
Owner

exogen commented Aug 23, 2018

I've been running a large amount of complex queries, and often it's the case that deeply nested results lead to lots of individual lookup queries for entities.

I hacked up a proof-of-concept that uses dataloader's batching feature to recognize such lookups and make them using the search endpoint.

e.g. /ws/2/recording?query=rid:"{MBID}" OR rid:"{MBID}" OR ...

Then it will automatically map the results to the original, individual lookup requests, so they don't even know a different endpoint was used.

It works surprisingly well. The search endpoint also tends to return more data for each entity by default. This can speed up queries by 20–50x and avoid waiting for rate limits to clear up.

I'm planning on a rewrite of the whole GraphBrainz "query engine" to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant