Thank you. Some code with .first() for newbies
nextpaper_id=db(db.papers.id > paper_id).select(limitby=(0,1),orderby=db.papers.id).first().id prevpaper_id=db(db.papers.id < paper_id).select(limitby=(0,1),orderby=~db.papers.id).last().id I guess .first=.last while limitby=(0,1) On 2 авг, 17:37, mdipierro <mdipie...@cs.depaul.edu> wrote: > use > > select(limitby=(0,1)).first() > > On Aug 2, 4:22 am, KMax <mkostri...@gmail.com> wrote: > > > > > Hello > > I have situation when .select() give lots of rows select().first() > > start consume lots of cpu. > > I work around this by changing query to minimize answer of select(). > > LOGGING = True gives this in profile.log > > ncalls tottime percall cumtime percall > > filename:lineno(function) > > 3 2.110 0.703 5.397 1.799 sql.py:3146(parse) > > > I guess something could be done to avoid workaround by sql-query, > > sorry if i am lame :) > > Thank you.