On Saturday, 5 March, 2016 14:03, James K. Lowden <jklowden at schemamania.org> 
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 <darren at darrenduncan.net> 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 previously fetched data for re-display then, thanks,
> at least I understand your point of view.

> For myself I can't imagine such a design.  After I've gone to the work
> of preparing the query fetching the results, and placing them in
> whatever construct is needed for display to the user, I'd certainly
> hang onto my display structures until the user was done with the
> data.   If the user wants to see it again, the last thing I'd want to
> do is repeat all that.

This is common and why there are so many programs that work find when selecting 
the "customer" from a list when using a testing database with 137 customers.  
When the application moves to production where there are hundreds of thousands 
of customers, the wheels fall off the bus.

> 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.

Unless, of course, the result set contains more than just a few records.

Interestingly enough, the wheels fall off the LIMIT + OFFSET bus at about the 
same place as they fall off the result-set cacheing bus.

The only thing worse is retrieving the entire result set and cacheing the whole 
think in the gooey structures.  Those wheels fall off the bus much sooner.




Reply via email to