[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread 邱朗
Here(http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor) said "Do not try to implement a scrolling window using LIMIT and OFFSET. Doing so will become sluggish as the user scrolls down toward the bottom of the list.?. But the page also said "This information is obsolete? https://www.sqlite.org

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Clemens Ladisch
?? wrote: > Here(http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor) said "Do > not try to implement a scrolling window using LIMIT and OFFSET. Doing > so will become sluggish as the user scrolls down toward the bottom of > the list.?. But the page also said "This information is obsolete? "Obsol

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread James K. Lowden
On Wed, 2 Mar 2016 14:12:04 +0100 Clemens Ladisch wrote: > > https://www.sqlite.org/lang_select.html talks about LIMIT & OFFSET, > > without mentioning that is a bad idea. > > Neither does it mention that it is a good idea. > > > can I do that or not (will it become sluggish if I do that) ? >

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Darren Duncan
On 2016-03-02 5:02 AM, ?? wrote: > Here... said "Do not try to implement a scrolling window using LIMIT and > OFFSET. Doing so will become sluggish as the user scrolls down toward the > bottom of the list.?. But the page also said "This information is obsolete? > ... talks about LIMIT & OFFSET, w

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread 邱朗
Clemens Ladisch wrote: > > https://www.sqlite.org/lang_select.html talks about LIMIT & OFFSET, > > without mentioning that is a bad idea. >> Neither does it mention that it is a good idea. >> > can I do that or not (will it become sluggish if I do that) ? >> When you use large OFFSET values, the

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread 邱朗
>A better way that is very similar is to use WHERE and LIMIT instead.I know >that but as I just replied to this thread, if I do that I will then have to >record each columns I use for each table I want scroll cursor. So from the >implementation point of view, using LIMIT & OFFSET is easier. Qiu

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Darren Duncan
On 2016-03-02 6:48 PM, ?? wrote: >> A better way that is very similar is to use WHERE and LIMIT instead. > > I know that but as I just replied to this thread, if I do that I will then > have to record each columns I use for each table I want scroll cursor. So > from the implementation point of v

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread 邱朗
So according to your answers and others, this limitation is always there even the document said "obsolete" ? Just want to double confirm. Thanks! Qiulang At 2016-03-03 11:06:08, "Darren Duncan" wrote: >On 2016-03-02 6:48 PM, ?? wrote: >>> A better way that is very similar is to use WHERE an

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Darren Duncan
Using OFFSET means you have to sort and count all the records you're skipping before getting to the ones you want, and using WHERE means you can avoid counting and only sort the ones you're not skipping. That is how it is, regardless of what that document you saw says. -- Darren Duncan On 2016

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread R Smith
On 2016/03/03 5:10 AM, ?? wrote: > So according to your answers and others, this limitation is always there even > the document said "obsolete" ? Just want to double confirm. > > > Thanks! To add to what Clemens already mentioned - this problem is not an SQLite problem, this problem is true an

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread Darren Duncan
On 2016-03-02 11:18 PM, R Smith wrote: > On 2016/03/03 5:10 AM, ?? wrote: >> So according to your answers and others, this limitation is always there even >> the document said "obsolete" ? Just want to double confirm. > > To add to what Clemens already mentioned - this problem is not an SQLite > pr

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread James K. Lowden
On Thu, 3 Mar 2016 10:43:26 +0800 (CST) ?? wrote: > > Can anyone describe a situation for which this style of LIMIT & > > OFFSET is advisable from the application's point of view? (The > > DBMS costs are obvious enough.) > > For me this is the easiest way to implement a scrolling cursor. > Ot

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-04 Thread Darren Duncan
On 2016-03-03 11:27 AM, James K. Lowden wrote: > On Thu, 3 Mar 2016 10:43:26 +0800 (CST) > ?? wrote: > >>> Can anyone describe a situation for which this style of LIMIT & >>> OFFSET is advisable from the application's point of view? (The >>> DBMS costs are obvious enough.) >> >> For me this is th

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-04 Thread R Smith
On 2016/03/04 10:35 AM, Darren Duncan wrote: > On 2016-03-03 11:27 AM, James K. Lowden wrote: >> >> You say, "record ... the condition ... to scroll [the table]". I'm >> sure I don't know what "condition" you mean. >> >> You appear to be doing something like: >> >> offset = 0 >> do >>

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-05 Thread James K. Lowden
On Fri, 04 Mar 2016 00:35:47 -0800 Darren Duncan wrote: > > How exactly is the first way "easiest"? > > If these are pages displayed to the user, they may want to scroll > backwards at some point; They might, and if you say it's easier to go back to the database than to keep track of previousl

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-05 Thread Keith Medcalf
On Saturday, 5 March, 2016 14:03, James K. Lowden said: > To: sqlite-users at mailinglists.sqlite.org > Subject: Re: [sqlite] Can I implement a scrolling window using LIMIT and > OFFSET ? > On Fri, 04 Mar 2016 00:35:47 -0800 > Darren Duncan wrote: > > > How exactly i

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-06 Thread James K. Lowden
On Sat, 05 Mar 2016 17:16:52 -0700 "Keith Medcalf" wrote: > > Sometimes it's faster to recompute something than to cache it for > > later re-use. That's rare where I/O is involved, and vanishing rare > > where SQL is involved. > > The only thing worse is retrieving the entire result set and cach