Stephan Beal wrote:
> On Fri, Feb 28, 2014 at 3:59 PM, L. Wood <lwoo...@live.com> wrote:
>> I can think of three ways:
>> * Call _prepare() with a query with single parameter for the ID.
>>   _bind(), _step(), and _reset() - repeat for each ID.

This is the obvious method to use.

>> Are there other ways?
>
> i don't know that this would be better, but it's a different way:
>
> collect the list into a temp table with one field (the to-delete id), then
> do a DELETE FROM x WHERE id IN temptablename

In this case, SQLite will construct a temporary list of values
to hold all the rowids before doing the actual deletions.

The overhead of constructing this list might or might not be larger than
the overhead of executing already-prepared statements.  However, if
there are too many IDs, that temporay list will affect the caches, or
might even need to be stored on disk.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to