Hello everyone!

I'm querying a legacy database and for performance issues I can't do an 
orderby and the end of the SQL (HUGE table).

If I do:

db().select(db.table.ALL, orderby=db.table.some_key, limitby=(0,1000))

It will issue as supposed: SELECT * FROM table ORDER BY *some_key* LIMIT 
1000 OFFSET 0;

But if I remove the "orderby":

db().select(db.table.ALL, limitby=(0,1000))

It will automatically issue: SELECT * FROM table ORDER BY *primary_key* 
LIMIT 1000 OFFSET 0;

Since I HAVE to define a primary key on the legacy table, Is there any way 
to avoid issuing an order by without having to do db.executesql manually?

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to