On 8 May 2015, at 1:27pm, Zaumseil Ren? <RZaumseil at kkg.ch> wrote:
> 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. > 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. 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. Simon.