Setting aside the fact that it seems silly to try to show people an
8 million row resultset...

   You could merge the two ideas: create a temp table containing just
the rowids you want, in the order that you want, and then use LIMIT
and OFFSET to get the particular ones you want.  Using those rowids,
retrieve the actual rows from the original table.  There are a couple
ways you can deal with the situation where a row gets deleted... I
leave that for you to ponder.

   Seriously though, I doubt that what you're trying to do is ever
really necessary, nor even desirable.  Nobody can actually look at,
comprehend or even do anything with 8 million rows of results...


On Wed, Feb 25, 2009 at 2:08 PM, Nikolas Stevenson-Molnar
<steve...@evergreen.edu> wrote:
> I'm working on a simple SQLITE database browser (part of a larger
> program) and I'm running into problems displaying larger (~8 million
> rows) tables. I originally set out using OFFSET and LIMIT to grab the
> rows I need to display on screen at any given time, but realized that
> this becomes horribly slow as one gets to the millionth row onward. I
> found this article: http://www.sqlite.org/cvstrac/wiki?
> p=ScrollingCursor which offers an alternative method, but I can't make
> use of it, as I have to allow for a variety of queries (and user-
> defined queries) and can't employ the constraints here. I also can't
> go by rowid, since I can't be certain that rows haven't been deleted.
>
> My temporary solution for the moment is to preload hold a couple
> thousand rows at a time in memory, which makes things somewhat
> bearable, and my only other idea is to create a temp table for every
> query which I can query by rowid, but I don't want to be copying
> potentially millions of rows all the time.
>
> Does anyone have any other ideas on how to do this?
>
> Thanks!
> _Nik
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to