-
Notifications
You must be signed in to change notification settings - Fork 694
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 adapter: performance issues during insert operations #1581
Comments
Do you create tables with Exposed or you use existing table? Can you share |
Yes. Tables created with SchemaUtils. As a result SQL query is produced by SchemaUtils. |
Do you have any SQLite specific parameters set to your connection? |
No. Something like this: val config = SQLiteConfig().also {
it.setSynchronous(SQLiteConfig.SynchronousMode.OFF)
it.setJournalMode(SQLiteConfig.JournalMode.OFF)
it.setPageSize(32_768)
it.setCacheSize(-8_000)
}
if (location == null) {
val url = "jdbc:sqlite:file:jcdb-${UUID.randomUUID()}?mode=memory&cache=shared&rewriteBatchedStatements=true"
dataSource = SQLiteDataSource(config).also {
it.url = url
}
} else {
dataSource = SQLiteDataSource(config).also {
it.url = url
}
} |
Hey @lehvolk. I tried to reproduce this issue with your setup but couldn't. Could you please verify that it still happens in the latest Exposed version (0.43.0 at the time of writing)?
How large? |
I have an application that doing large number of inserts during startup. CPU snapshot shows that about 10% of time consumed by creating SQLExcpetions based on missed columns in ResultSet returned by JDBC driver.
Preconditions
Having this as dependencies
Having dummy scheme:
and code:
This code produces 4 SQLExceptions with message
no such column: 'id'
andno such column: 'id'
,no such column: 'path'
.no such column: 'runtime'
andno such column: 'outdated'
As I can see in debug after insert driver returns result set for query
select last_insert_rowid()
and Exposed tries to restore entity with it.The text was updated successfully, but these errors were encountered: