django-debug-toolbar icon indicating copy to clipboard operation
django-debug-toolbar copied to clipboard

It doesnot count query while making query from another thread

Open amankumarjain opened this issue 7 years ago • 2 comments

How to debug database query when query is executed from separate thread.

amankumarjain avatar Apr 18 '17 22:04 amankumarjain

Same problem +1

diegobill avatar May 09 '19 14:05 diegobill

This may be because Django ensures that all database connections are cursors differ between threads.

I think it may be very hard to implement cross-thread tracking of queries; there probably aren't easy ways to determine the originating thread in the general case; patching the threading module may work but maybe it won't. Also, the work would probably have to be redone for the async case. So, if anyone has a good idea how to implement this, please contribute (code or ideas) but for now I'm leaning towards closing this as not planned.

matthiask avatar Jan 20 '23 19:01 matthiask