Queries selecting too much data
See original GitHub issueA query like this:
{
allTimeobjects (first:1) {
edges {
node {
id,
beginning,
end,
elapsed
}
}
}
}
Executes the exact same SQL as this:
{
allTimeobjects {
edges {
node {
id,
beginning,
end,
elapsed
}
}
}
}
They also both select all columns and not only the ones we are asking for. (only tested on sqlite but assume postgresql would be the same behavior)
#402 related
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Simple Select Query taking too much time in mysql-table with ...
My first suggestion is to fix your data model. I suspect you are storing multiple values in keywords . These should be in...
Read more >SQL Performance Tuning: 15 Go-To Tips to Fix Slow Queries
For example, when you INSERT data and UPDATE data, too many indexes will slow you down. Here's what to do: Always try to...
Read more >Reducing the Number of Reads in Your Queries - Data with Bert
It's possible that your query is already as selective as it can be. Maybe you are getting too many reads because SQL Server...
Read more >Chapter 4. Query Performance Optimization - O'Reilly
The most basic reason a query doesn't perform well is because it's working with too much data. Some queries just have to sift...
Read more >Supercharge Your SQL Queries for Production Databases
When running exploratory queries, many SQL developers use SELECT * (read as “select all”) as a shorthand to query all available data from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@OskarPersson @wolendranh I don’t like the idea of building into graphene-django something that always automatically selects only fields that are requested because I think it could actually lead to worse behaviour since Django can’t cache queries consistently. However I would recommend using something like graphene-django-optimiser on a case by case basis if it helps you.
Separately I think #250 is a very good idea and when I get time I’ll look into implementing it.
Going to close this issue now in favour of tracking everything in #250
@OskarPersson I get your point. But maybe something like https://github.com/tfoxy/graphene-django-optimizer can be incorporated. Taking into account that related #250