-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Using variables destroys performance #2316
Comments
Use non nullable variables. The query plan caching kicks in when all the variables are non-nullable scalars. query($user:Int!, $status: Int!){
user_news(where: {user_id: {_eq: $user}, status: {_eq: $status}}, limit: 10, order_by: {id: desc}) {
id
}
} |
Also, if you can spare more than one core to graphql-engine, you can set |
Yep, non nullable variables brought it to 90+% of non variable query performance. The trick with with |
We'll add this to documentation.
Historical reasons. We'll set it as the default in the next release. |
Thanks. I would leave this open as reminder |
Query without variables:
Throughput: 3800 req/s
Query with variables:
Variables:
Throughput: 980 req/s
In more complex example where I first noticed this performance drop it went from ~1500req/s to ~250req/s.
The text was updated successfully, but these errors were encountered: