Thursday, May 30, 2013

Is it possible to add SQL comments to a query built with the ORM?

Hint: This is a cross-post from http://stackoverflow.com/questions/16831162/is-it-possible-to-add-sql-comments-to-a-query-built-with-the-orm

I am trying to identify slow querys in a large-scale Django 1.3 web application. As it is kind of difficult to match the raw sql query in the slow query log with the specific ORM statement in the code, I wondered if it is possible to add a SQL comment to the query constructed with the ORM, something like..

Object.objects.filter(Q(pub_date__lte=datetime.now)).comment('query no. 123')


Kind regards 
Timo

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment