I am trying to insert 10000 records and its taking 45 secs
this is my code
println(NSDate.new())
for index in 0...10000{
countrys.insert(name <- "abc")
//println(index)
}
println(NSDate.new())
is this way to do it?
I am trying to insert 10000 records and its taking 45 secs
this is my code
println(NSDate.new())
for index in 0...10000{
countrys.insert(name <- "abc")
//println(index)
}
println(NSDate.new())
is this way to do it?
Copyright © 2021 Jogjafile Inc.
The issue is that SQLite will have to commit each of the
INSERTstatements individually. You should consider using transactions. You can start a transaction withtransactionmethod (which performsBEGIN TRANSACTIONSQL) and then usecommitto commit them (which performsCOMMITSQL).For example: