Re: [sqlite] DB on JFFS

2017-11-04 Thread Simon Slavin


On 4 Nov 2017, at 4:29pm, Lev  wrote:

> That is a good idea, thanks. So it might look like this?
> 
> BEGIN TRANSACTION;
> 
> INSERT ...
> INSERT ...
> 
> COMMIT;

Yes.

> Also, I don't really know how to set up a cache.

Don;’t bother with that at the moment.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] DB on JFFS

2017-11-04 Thread Lev
On Fri, 3 Nov 2017 21:40:52 +
Simon Slavin  wrote:

> Those two are in conclict.  You might like to try putting BEGIN … END
> around your inserts just for testing.

That is a good idea, thanks. So it might look like this?

BEGIN TRANSACTION;

INSERT ...
INSERT ...

COMMIT;


Also, I don't really know how to set up a cache. I open my database as follows:

sqlite3_open_v2(sdmd->sqlite_fn, >db, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_PRIVATECACHE, NULL);

Despite the privatecache, I experience that evry INSERT is written to the disk 
when I call sqlite3_finalize().


Thank you very much for your help.
Levente
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] DB on JFFS

2017-11-03 Thread Simon Slavin


On 3 Nov 2017, at 9:35pm, Lev  wrote:

> I call these function at each INSERT:
> 
> sqlite3_prepare_v2(sq3, query, -1, _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.

Those two are in conclict.  You might like to try putting BEGIN … END around 
your inserts just for testing.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] DB on JFFS

2017-11-03 Thread Lev
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, _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