index support is on the way but for the time being just stick an index manually. a CREATE INDEX ix_foo_foo_date on foo (foo_date) should suffice.
on further iterations, you should consider how much you'd like to be exact showing the last 10 registers: you can't really expect to scale (index or no index) if every hit to the page sends a query for the last 10 registers on a 6M rows table. The first thing to consider would be caching the damn select ^_^. The second to use a smaller table that gets periodically truncated and refreshed (say, every 5 minutes) in the background by a scheduler task that fetches the latest records from the "big one" and inserts the records on the smaller. -- 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.