Code

Opened 6 years ago

Closed 5 weeks ago

#9363 closed New feature (wontfix)

[feature request] track down where a query is requested for debugging

Reported by: pihentagy Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Normal Keywords: debug , query
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm not a python wizard, so I'm just suspecting the following is possible:

When you examine connection.queries, it would be great to write out the file and the line, from the Query comes from.
Ok, one must define where the query created (the first time you say filter on a manager, the last time ...), but this should help greatly figuring out why certain queries are executed.

Attachments (0)

Change History (8)

comment:1 Changed 5 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:3 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:4 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:5 Changed 4 months ago by claudep

#22320 was a duplicate with a patch. I think the idea is good, however I'm a bit worried about the memory consumption, even if production sites should not be affected. IMO, fixing #12581 is a prerequisite to this one.

comment:7 Changed 4 months ago by claudep

  • Has patch set

comment:8 Changed 5 weeks ago by aaugustin

  • Resolution set to wontfix
  • Status changed from new to closed

This feature is provided by the Django Debug Toolbar. It even works for templates. If you need this feature, just install the Debug Toolbar.

I know what the code looks like, and I'd rather leave it up to third-parties...

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.