Git Product home page Git Product logo

Comments (4)

twig avatar twig commented on August 19, 2024

The main reason why I'm using the debug toolbar is to reduce the number of DB queries and increase the site performance.
This feature would be very handy!

from django-debug-toolbar.

mikery avatar mikery commented on August 19, 2024

I have implemented this feature in my fork (https://github.com/mikery/django-debug-toolbar/commit/27cfc7b6bdcdde4cf1e88e6502b84852915d6cf9). Once I have made it a bit more flexible I will try making a pull request to see if we can get this feature in the official master branch. If you try it out, please let me know if you have any comments or suggestions.

from django-debug-toolbar.

aaugustin avatar aaugustin commented on August 19, 2024

I've closed a stale pull request. This issue doesn't look entirely straightforward to me. For instance, how do we collapse queries that only differ by the value of some parameter? How do we handle repeated series of queries: A, B, C, A, B, C, A, etc.?

If you want to tackle this ticket, I suggest discussing a design with a maintainer before developing a solution.

from django-debug-toolbar.

robhudson avatar robhudson commented on August 19, 2024

The idea I had many years ago was that in the debug cursor the sql and params arguments are separate. So anywhere where the sql was the same increment a counter on that sql. The SQL parameters could be different, no problem. This might help to see that you're doing hundreds of SQL queries for the same table and that SQL is querying by ID -- which could give you a clue that you might need a select_related to avoid all those single pk lookups, e.g.

from django-debug-toolbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.