I need very fast access to various subsets of data from a table so I am trying to write a cache for a subset of the rows. The cache must be “sort” aware. The table is read only do I dfont need to worry about keeping the cache upto date.
The table itself has about 30 columns and I need to cache all of them. However, for various reasons there are implementation issues that mean that my starting point is a query that includes the primary index (id) and additional columns that are the columns on which the main table is currently sorted. What I want to do is a second query on the dataset selecting 100 rows before and after the current row and place them into a second (temporary) table. For an unsorted table (or rather sorted by ID) I could do the following “select * from table where ID >= (refID-100) limit 200 This would return the 200 row window as required However the remaining fields are not all numeric so this (minus 100) will not work The dataset will already be sorted and is large (a few million rows) so I need to avoid doing a subsequent sort – the user interacts in real time and even a seconds delay will be too long and make it too sluggish. I have read the sqlite scrolling cursor page and think that I might have a problem here but thought I would ask for help - Anyone have any ideas how this might be achieved? Cheers _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users