I have a table of 10000 rows, from which I have to update 1000 rows. This takes me 10-20 secs. Is there a way to do this faster ?
My 1000 sql statements are as follow:
update table set value=x where rowid=y
(x and y are integers, rowid is the internal rowid of sqlite3)
My sql statement I provide to my function:
func executeSQL(sSQL:String) -> Bool {
var bReturn:Bool=false;
var statement:COpaquePointer = nil
if sqlite3_prepare_v2(db, sSQL, -1, &statement, nil) != SQLITE_OK {
println("Failed to prepare statement")
//exit(1)
}else{
if sqlite3_step(statement) == SQLITE_DONE {
println(sSQL);
bReturn=true;
}
sqlite3_finalize(statement);
}
return bReturn;
}