> The actual truth depends on finicky details of your own setup.  But see the 
> last part of this page:
>
> <https://www.sqlite.org/lang_delete.html>
>
> "When the WHERE is omitted from a DELETE statement and the table being 
> deleted has no triggers, SQLite uses an optimization to erase the entire 
> table content without having to visit each row of the table individually. 
> This "truncate" optimization makes the delete run much faster."
>
> It may technically still be faster to do DROP/CREATE but it's more correct to 
> do DELETE and with this optimisation it will be very fast.
>
> I just wanted to add that if you have multiple tables with the same schema 
> (same columns of the same types) then you may get better results by merging 
> all the tables together, just adding one column with what used to be the 
> table name.  This > means you would no longer have to do operations on many 
> different tables, you could just use the table name as a WHERE > parameter.  
> And you could empty all your tables with one command.
>
> Simon.

I started with the single table solution. But it was to slow on select and the 
database was also bigger because of the id for each row. Now I can use the 
timestamp as rowed.

Btw. How big is the overhead of calling multiple commands instead of one?
I do sqlite3_prepare() for all commands on the beginning and in the running 
only sqlite3_reset(), sqlite3_bind*() and sqlite3_step().


Regards
Rene

Kernkraftwerk Goesgen-Daeniken AG
CH-4658 Daeniken, Switzerland

Diese Nachricht (inkl. Anhaenge) beinhaltet moeglicherweise vertrauliche oder 
gesetzlich geschuetzte Daten oder Informationen. Zum Empfang derselben ist 
(sind) ausschliesslich die genannte(n) Person(en) bestimmt. Falls Sie diese 
Nachricht irrtuemlicherweise erreicht hat, sind Sie hoeflich gebeten, diese 
unter Ausschluss jeder Reproduktion zu vernichten und den Absender umgehend zu 
benachrichtigen. Besten Dank.

Reply via email to