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

Knex adapter performance #3568

Open
DaddyWarbucks opened this issue Feb 19, 2025 · 0 comments
Open

Knex adapter performance #3568

DaddyWarbucks opened this issue Feb 19, 2025 · 0 comments

Comments

@DaddyWarbucks
Copy link
Member

In the _find method, countBuilder and builder should be run in parallel when possible.

const data = filters.$limit === 0 ? [] : await builder.catch(errorHandler)

This would basically 2x performance on the most common find queries. Instead of finding and then counting, run both in a Promise.all.

Also, investigate "returning" for update and patch methods. I see that the create method supports this. I wonder if the builder.update supports this. If so, the secondary query is no longer needed and has considerable performance gain. See the MongoDB adapter for an example.

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

No branches or pull requests

1 participant