Re: [sqlite] quickly insert multiple rows into multiple table

2010-07-12 Thread Eric Smith
W.-H. Gu wrote: > For (1), after I wrapped inserts into a transaction, I face an issue: > the cpu usage is too high. I think the reason is that I use prepare > statement to insert a row at a time, it than does sqlite3_step for > thousands times every second. If I'm reading this right,

Re: [sqlite] quickly insert multiple rows into multiple table

2010-07-12 Thread W.-H. Gu
Hi, For (1), after I wrapped inserts into a transaction, I face an issue: the cpu usage is too high. I think the reason is that I use prepare statement to insert a row at a time, it than does sqlite3_step for thousands times every second. Every second I insert 9184 rows, which

Re: [sqlite] quickly insert multiple rows into multiple table

2010-07-12 Thread Kees Nuyt
1On Mon, 12 Jul 2010 09:29:35 -0700, "W.-H. Gu" wrote: >Hi, > > I have 5 tables. Every second I want to insert 1 row into the main table, >and multiple rows into every other table. What I do right now is to prepare >5 statements for those 5 tables, where the statements for

[sqlite] quickly insert multiple rows into multiple table

2010-07-12 Thread W.-H. Gu
Hi, I have 5 tables. Every second I want to insert 1 row into the main table, and multiple rows into every other table. What I do right now is to prepare 5 statements for those 5 tables, where the statements for multiple row insertion is like INSERT INTO MyTable (FirstCol, SecondCol)