Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-02 Thread Johann Spies
On 1 June 2015 at 20:22, Anthony wrote: > Thanks Anthony. Correct. I do not want it in all cases. After reading up >> on it I came accross this link ( >> http://chrisdone.com/posts/postgresql-pagination) where the author >> illustrates just how slow PostgreSQL's "OFFSET" can be which is probabl

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Derek
Yeah, I had to explain that to a few of my coworkers once. If it's faster to give you your data unordered, and you didn't specify an order, you're going to get it in any kind of order. Like if another query before yours returns the exact same data but it's reverse ordered... well, if you do tha

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Anthony
> > Thanks Anthony. Correct. I do not want it in all cases. After reading up > on it I came accross this link ( > http://chrisdone.com/posts/postgresql-pagination) where the author > illustrates just how slow PostgreSQL's "OFFSET" can be which is probably > part of my problem in this case. I

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
On 1 June 2015 at 13:38, Anthony wrote: > Just to be clear, the old behavior was a bug (and a particular problem > when the user sorted on a column within the grid, which overrides the > original orderby). Pagination is a fundamental feature of the grid, so it > ought to "just work." Note, we can

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Anthony
Just to be clear, the old behavior was a bug (and a particular problem when the user sorted on a column within the grid, which overrides the original orderby). Pagination is a fundamental feature of the grid, so it ought to "just work." Note, we cannot leave it up to the developer to explicitly

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
Thank you for the "sermon" :) Regards Johann -- 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 th

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Niphlod
just to clarify: the fact that a query in pgadmin returns a somewhat ordered resultset "that you're good with", that you "test queries in raw postgresql before you implement" and that web2py shows the same result with auto_pagination=False is not in ANY scenario an assurance of the fact that yo

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
After reading the discussion Anthony referred to, I would like to state that I prefer the behaviour of the DAL/Grid query to result in the same outcome as if I would have done with a raw query in PostgreSQL. I test my queries in PG before I implement them in web2py because I work with fairly large

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-06-01 Thread Johann Spies
On 28 May 2015 at 15:28, Anthony wrote: > > On Thursday, May 28, 2015 at 6:33:25 AM UTC-4, Johann Spies wrote: > 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 matchin

[web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Anthony
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. >

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Anthony
On Thursday, May 28, 2015 at 7:17:29 AM UTC-4, Johann Spies wrote: > > > > On 28 May 2015 at 12:42, Niphlod wrote: > > auto_pagination = False. >> > > When did this become part of Web2py? I do not find it in the Changelog. > It works in the latest version but no in 2.9.5. > Was originally disc

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Anthony
On Thursday, May 28, 2015 at 6:53:58 AM UTC-4, Johann Spies wrote: > > > > On 28 May 2015 at 12:42, Niphlod wrote: > > auto_pagination = False. >> >> That being said, mind that without ordering, pagination is inherently >> incorrect >> >> > Thanks. Will that not respect my orderby = ~db.isi_alt

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
On 28 May 2015 at 12:42, Niphlod wrote: auto_pagination = False. > When did this become part of Web2py? I do not find it in the Changelog. It works in the latest version but no in 2.9.5. Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github

[web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread 黄祥
perhaps you can turn of the sortable in grid and just use orderby e.g. sortable=False best regards, stifan -- 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) -

Re: [web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
On 28 May 2015 at 12:42, Niphlod wrote: auto_pagination = False. > > That being said, mind that without ordering, pagination is inherently > incorrect > > Thanks. Will that not respect my orderby = ~db.isi_alt_names.code? I just do not want the extra ordering added. Maybe one can patch the cod

[web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Niphlod
auto_pagination = False. That being said, mind that without ordering, pagination is inherently incorrect On Thursday, May 28, 2015 at 12:33:25 PM UTC+2, Johann Spies wrote: > > Apologies for the unfinished message. The Gmail interface in the browser > and I am not really friends. > > The prob

[web2py] Re: Web2py adding additional and not wanted orderby

2015-05-28 Thread Johann Spies
Apologies for the unfinished message. The Gmail interface in the browser and I am not really friends. 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