Well, it does not affect the performance and I still get:

Server Software:        Apache/2.2.8
Server Hostname:        localhost
Server Port:            80

Document Path:          /l
Document Length:        87305 bytes

Concurrency Level:      100
Time taken for tests:   17.146102 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      87721608 bytes
HTML transferred:       87500948 bytes
Requests per second:    58.32 [#/sec] (mean)
Time per request:       1714.610 [ms] (mean)
Time per request:       17.146 [ms] (mean, across all concurrent
requests)
Transfer rate:          4996.18 [Kbytes/sec] received


On Mar 19, 12:46 pm, Mike Conley <mconl...@gmail.com> wrote:
> I believe #1 will iterate on the cursor retrieving one object from  cursor
> on each iteration, while #2 retrieves all objects then processes the
> entire result set in Python.
>
> Try changing #1 to use
>
>    for o in session.query(Object).all()
>
> to retrieve all objects before doing the iteration, same as #2.
>
> >    """
> >    #1. use session
> >    output = '\n,'.join(['%s: %s %s %s %s %s %s %s %s'%(o.id,
>
> > o._owner_id,o._created,o._created,o._creator_id,
>
> > o.class_id,o.type,o.singular_label,o.plural_label)
> >                       for o in session.query(Object)])
> >    """
>
> >    #2. use raw sql
> >    output = '\n,'.join([str(p) for p in session.connection().execute
> > (s).fetchall()])
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to