Is this reproducible?
This happens all the time, if I do it ten times in a row every time it takes
38-39 seconds. Even with lynx on the server itself it takes about 40 seconds.
If I use:
t0=time.time()
orders = db(db.orders.id> 0).select()
logging.info('time to fetch %s' % (time.time()-t0))
The time is 1.75 - 1.90 seconds to fetch the data from database
I change the controller to this
sql = db(db.orders.id> 0)._select()
t0=time.time()
db.executesql(sql)
logging.info('time to fetch %s' % (time.time()-t0))
orders=[]
now I get times like 0.38 - 0.39 seconds
If I instead of db.orders.id< 490) to get half the rows all times drops to
half, even 40 seconds is now 20 seconds.
Just testing I tried with:
t0=time.time()
orders = db(db.orders.id> 0).select()
orders1 = db(db.orders.id> 0).select()
orders2 = db(db.orders.id> 0).select()
orders3 = db(db.orders.id> 0).select()
orders4 = db(db.orders.id> 0).select()
logging.info('time to fetch %s' % (time.time()-t0))
return orders
This takes about, 5x1,8s (to fetch data) + 35 seconds = 45 seconds
I tried with a different table that contains about 1250 rows, 6 columns. It
takes 1.2-1.3 seconds to fetch the data, but then over 60 seconds to display it.
Kenneth