On Thursday, May 28, 2015 at 6:33:25 AM UTC-4, Johann Spies wrote: > > > The problem with the abovementioned query is that it adds a lot of load to > the server as there are 130+ million records in the rresearch table and > about as much in the isi_alt_names table making the query very slow. > Without the 'rresearch.id' in the orderby-section the query runs for > about 200 ms and with it the sorting and merging of the sort results of the > two tables takes about 7 minutes. >
Does the db.isi_alt_names.code field contain unique values? If not, I don't think your pagination is guaranteed to work (i.e., you could get back different orderings within matching values of "code" on each select). Anthony -- 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.