Sorry for the incomplete post, stupid phone.

On May 17, 2014 8:40 PM, "Simon Slavin" <slav...@bigfraud.org> wrote:
> Just want to check: this is what it sounds like, right ?  Your user has a
window open where they are scrolling through the table, ordered by
SomeColumn.  You need to know whether the window needs to change to reflect
the new row.  Is that right ?

In a nutshell. Further it needs to work in an environment where I control
the data model but not the view or controller, so when a new record comes
in, I need to know which row it is per current sort order so the model can
advertise the new row to the view.

> > SELECT COUNT(*) FROM SomeTable WHERE SomeColumn = value ORDER BY
SomeColumn
>
> The second SELECT doesn't need the ORDER BY.  It will have no effect.

Sorry, typo. I meant <=, fingers and brain out of sync.

> How many columns does a table have ?  Roughly.  If it's not a lot all you
need to is create one index for each column that might be chosen as
'SomeColumn'.  Or have you already done this and the speed your complaining
about is the speed with the index

Yes, speed for large collections is inadequate.

> One technique I used to use in the old days (long before SQL) was to keep
a second table which contained just the rows that were shown on the
display.  So you'd have your full database on backing store and then
another table with just 20 rows.  To see whether your new row will effect
the display, you just compare it with the first and last entries in the
display table, which is very small so it's fast to do things with.

That would by far make the most sense. Maybe I can invert control between
the view & model. Thanks for the thought.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to