Comment by tored
4 years ago
You can also use a VIEW.
How does GraphQL make sure to respect table indexes? If not you get a super slow query.
4 years ago
You can also use a VIEW.
How does GraphQL make sure to respect table indexes? If not you get a super slow query.
You can still get performance issues with a view if you "select *" on a large amount of data, or join with other views. By exposing the SQL to a web page, you also open up for DDoS attacks more easily, as you can write complex SQL queries
You can get the same problems with GraphQL or stored procedures too of course, if the queries are not optimized correctly
So what's the solution to this?
Performance quotas.
Because a human is writing the resolvers pulling the data from the database. Set whatever index you want to use.