Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite: pragma and transaction #261

Open
dimasagalov opened this issue Sep 17, 2020 · 0 comments
Open

SQLite: pragma and transaction #261

dimasagalov opened this issue Sep 17, 2020 · 0 comments

Comments

@dimasagalov
Copy link

dimasagalov commented Sep 17, 2020

While working with a bunch of libiec61850 + SQLite3, I ran into the problem that SQLite3 has very low performance with the settings out of the box (individual synchronous inserts, each ~20ms). And there is no way to customize db.
My suggestion is to expand the interface:

  1. introduce a function 'SqliteLogStorage_createInstance_ext' with argument through which you can pass pragmas before creating the db instance.
  2. introduce a function 'SqliteLogStorage_exec' (wrapper for sqlite3_exec) through which direct SQL queries can be passed. In particular, through them, you can create a transaction that stores all statements in the cache and runs them when the transaction ends - which is much more productive than individual inserts. The transaction begins after locking the data model and ends before unlocking it.
    In attach - possible implementation approach
    sqlite_pragma_and_transaction.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant