question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Queries selecting too much data

See original GitHub issue

A 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jkimbocommented, Jul 25, 2019

@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

0reactions
wolendranhcommented, Jul 25, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found