[R-sig-DB] concurrent reading/writing in "chunks" with RSQLite (need some help troubleshooting)

Sean Davis @d@v|@2 @end|ng |rom m@||@n|h@gov
Tue Jul 6 00:23:22 CEST 2010


On Mon, Jul 5, 2010 at 4:09 PM, Seth Falcon <seth using userprimary.net> wrote:

>
> > Along the lines of Keith's solution, I noticed the COUNT query can be
> > VERY slow -- there is no rapid way of getting the number of rows in a
> > database table?
>
>
One way of dealing with this situation using RDBMs is to use a set of
triggers (an insert and delete pair) to keep the count in a separate table.
 I'm sure there are some examples/discussion online for creating triggers in
SQLite.

Sean



> No, there is no notion of number of rows in a table that I am aware
> of.  Note that COUNT is a way of aggregating the number of rows
> returned from a query and in general there is no way for the db to
> know how many rows will match a query.
>
> I expect Keith's solution to be quite slow.  It is executing a
> separate query each time through the loop and making a linear scan
> through the table to do the offset.
>
> + seth
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
>

	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list