Sorry for the delay.

>> 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.
>
>If it was slow on SELECT I suspect you didn't have an appropriate INDEX.  But 
>my suggestion about this was just a minor part of my answer and if your setup 
>works for you it is not a bad setup.
>

With a single table and appropriate indices I have nearly the double size of 
the database :(
Currently I use one column with "integer primary key asc" as rowed and another 
for the real value.

>> 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().
>
>My understanding is that you cannot bind a TABLE name to a parameter, so with 
>your current setup you wouldn't be able to >use the same statement with 
>multiple tables.  If you collapse your data into one TABLE then you could just 
>rebind one >parameter as you move from one set of data to another.
>

I have one prepared statement for each table to delete the whole table "delete 
* from tablename" and one to delete only values after a given time. The last 
one will use the time as bind parameter.

>But I cannot even guess how speed would change between the two models.  They 
>depend too much on the sizes of the >tables and how fast various components of 
>your computer are.  The main convenience of having one table instead of many 
>>is that it usually means you do less programming.
>

Sure. My main problem is still the time of a delete statement. It takes some 
minutes to delete all data from all tables. May be it is also a hardware 
problem. I found recently a thread about disabling indexing on windows 
directories. I will try this and play with the sqlite settings.

I also tried to recreate the database. It failed sometimes because after "db 
close" I could not always delete the file. Windows gave a permission denied. 
And then you also run in problems when the database is read from other 
processes.
It would be nice to have a command inside sqlite to clear an entire database.

>Simon.

Thank you for your input.
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