Thanks for the suggestion. I started a web2py session from the command
line, and ran a simple DAL select from there.
python web2py.py -M -S myapplication
result =
db2(db2.soe_tdb.pointnumber>0).select(db2.soe_tdb.ALL,limitby=(0,10))
print db2._timings
[("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'",
0.001035928726196289), ("ALTER SESSION SET NLS_TIMESTAMP_FORMAT =
'YYYY-MM-DD HH24:MI:SS'", 0.0008900165557861328), ('SELECT soe_tdb.utctime,
soe_tdb.miliseconds, soe_tdb.pointnumber, soe_tdb.pointname,
soe_tdb.stationname, soe_tdb.statenumber, soe_tdb.statename,
soe_tdb.groupname, soe_tdb.tv_sec, soe_tdb.tv_usec, soe_tdb.confirmed FROM
(SELECT w_tmp.*, ROWNUM w_row FROM (SELECT soe_tdb.utctime,
soe_tdb.miliseconds, soe_tdb.pointnumber, soe_tdb.pointname,
soe_tdb.stationname, soe_tdb.statenumber, soe_tdb.statename,
soe_tdb.groupname, soe_tdb.tv_sec, soe_tdb.tv_usec, soe_tdb.confirmed FROM
soe_tdb WHERE (soe_tdb.pointnumber > 0) ORDER BY soe_tdb.utctime) w_tmp
WHERE ROWNUM<=10) soe_tdb WHERE (soe_tdb.pointnumber > 0) AND w_row > 0
ORDER BY soe_tdb.utctime', 59.642492055892944)]
The select took about a minute whether I used web2py version 2.9.5, 2.11.2
or 2.12.3. This does suggest that something changed to SQLFORM.grid
between 2.11 and 2.12. I'll dig a little deeper by trying some variations
on my use of SQLFORM.grid.
Thanks, - Tom
On Tuesday, November 10, 2015 at 12:30:55 AM UTC-6, Paolo Valleri wrote:
> Hi,
> there should be something wrong going on.
> As a first step, I'd write a simple query (i.e., select(db.table.ALL,
> limit=(0,10)) using pydal (the database abstraction layer used in web2py)
> and try to find out in which version has been introduced this performance
> issue. If you don't find a performance issue on pydal, then there should be
> something in the SQLFORM.grid part.
>
> Paolo
>
> On Sunday, November 8, 2015 at 6:16:31 AM UTC+1, tomt wrote:
>>
>> Hi,
>>
>> I encountered really slow responses when I was using my web2py app to
>> access an oracle database. I tried to use dbstats in response.toolbar to
>> measure this, but it wouldn't show the sql or any timing information. I
>> decided to try downgrading to an older web2py version, 2.11.2, and noticed
>> a dramatic change.
>>
>> web2py 2.11.2 query took 4 seconds
>> web2py 2.12.3 query took > 2 minutes
>>
>> I've tried this several times, with the same result. Were there any
>> changes in web2py that could account for this?
>>
>> The query I am running was passed to sqlform.grid
>>
>> soequery = ( (db2.soe_tdb.utctime > fromdate)&\
>> (db2.soe_tdb.utctime < todate)&\
>> (db2.soe_tdb.stationname.belongs(stationlist))&\
>> (db2.soe_tdb.pointnumber == db2.statuspoint.pointnumber)&\
>> (db2.statuspoint.pointaccessarea ==
>> db2.accessareaassignment.setnumber)&\
>> (db2.accessareaassignment.referencename == 'SOE')&\
>> ~(db2.statuspoint.pointname.like('%@%')) )
>>
>> orderby = [db2.soe_tdb.utctime]
>>
>> grid=SQLFORM.grid(
>> query=soequery,
>> deletable=False,editable=False,details=False,
>> searchable=True,fields=fields,headers=headers,
>> paginate=10,csv=False,maxtextlengths=maxtextlengths,
>> orderby=orderby,
>> )
>>
>> Please let me know if there is any other information that I could provide
>> to try to resolve this.
>>
>> Thanks in advance, - Tom
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.