In addition to putting mutiple inserts within a single transaction (this saves 
"disc" IO), you might like to look into using parameters (this saves on CPU 
spent parsing/compiling the statements. This leaves you with:

(setup)
connect
prepare
BEGIN

(loop)
bind
step
reset

(cleanup)
END
finalize
disconnect

-----Urspr√ľngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Lev
Gesendet: Freitag, 03. November 2017 22:36
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] DB on JFFS

I'm implementing an application that is on a flash filesystem (JFFS).
The flash is connected to the CPU with SPI.

I experience about 1s INSERT time. My DB isn't big, just about 200k. I 
implement a fifo like operation, so i have a fixed length row count. I DELETE 
old data from time to time.

I call these function at each INSERT:

sqlite3_prepare_v2(sq3, query, -1, &sq3_stmt, NULL); sqlite3_step(sq3_stmt); 
sqlite3_finalize(sq3_stmt);

query holds the INSERT SQL.

The question is what can I do to speed up the INSERT proces? The database is 
also opened by other processes, so I want to lock the table as short time as I 
can.

Any hints are welcome.

Thanks,
Levente
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to