On Nov 4, 2:02 pm, Knut Nesheim <knut.nesh...@mtab.se> wrote:
> Hello all,
>
> I'm trying to do some profiling on an application so I know where to  
> optimize and how I can expect it to perform with large datasets. I use  
> the debug toolbar to inspect sql queries.
>
>  From time to time certain pages will generate ~100 duplicated extra  
> queries. These pages lists orders and every order has two foreign keys  
> to Country. I use select_related to select the countries.
>
> All duplicated queries retrieve the same country. I have sifted  
> through the codebase and cannot find any rogue loop or such.
>
> Is there a way to trace an sql statement back to the offending python  
> statement?
>
> Regards
> Knut
> --
> Knut Nesheim  | MTAB Transport & Spedition AB
> Box 20164 | SE-161 02 Bromma | Visiting address: Ranhammarsvägen 26
> Phone: +46 8 54 600 153
> E-mail: knut.nesh...@mtab.se  | Web:www.mtab.se
>
> Vi utför alla uppdrag på grundval av NSAB 2000.
> All transactions are carried out according to our standard conditions  
> covered by NSAB2000

Hello,

I guess by "debug toolbar" you mean the django-debug-toolbar (http://
pypi.python.org/pypi/django-debug-toolbar/0.8.0). If that is the case,
django-debug-toolbar has a number of options and among them
HIDE_DJANGO_SQL (set to True by default), which makes django' function
calls not to appear in query stacktraces. If you set it to "False",
you will be able to see the whole stacktraces. You can read up on the
rest of the options on the related package index page (at least,
that's where I've learned about them).

Hope that helped

Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to