#14700: Speed up RawQuerySet iterator
---------------------------------------------------+------------------------
          Reporter:  akaariai                      |         Owner:  nobody     
                       
            Status:  reopened                      |     Milestone:  1.3        
                       
         Component:  Database layer (models, ORM)  |       Version:  SVN        
                       
        Resolution:                                |      Keywords:  
rawqueryset, iterator, performance
             Stage:  Accepted                      |     Has_patch:  1          
                       
        Needs_docs:  0                             |   Needs_tests:  0          
                       
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Changes (by intgr):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 This patch causes a regression for us. All raw queries seem to be executed
 twice!

 This is using Django SVN trunk revision 14778, with an empty project:

 {{{
 [ma...@wrx]% ./manage.py shell
 Python 2.7.1 (r271:86832, Dec  2 2010, 03:01:28)
 Type "copyright", "credits" or "license" for more information.

 IPython 0.10.1 -- An enhanced Interactive Python.
 ?         -> Introduction and overview of IPython's features.
 %quickref -> Quick reference.
 help      -> Python's own help system.
 object?   -> Details about 'object'. ?object also works, ?? prints more.

 In [1]: from django.db import connection

 In [2]: from django.contrib.auth.models import User

 In [3]: connection.queries
 Out[3]: []

 In [4]: list(User.objects.raw('select * from auth_user'))
 Out[4]: [<User: some_user>]

 In [5]: connection.queries
 Out[5]:
 [{'sql': u'select * from auth_user', 'time': '0.000'},
  {'sql': u'select * from auth_user', 'time': '0.000'}]
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14700#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to