D
D
dandewine2015-04-05 11:49:11
Java
dandewine, 2015-04-05 11:49:11

What is faster, updating information in the database or deleting and writing?

The question is whether updating data through a standard query will work faster, or deleting and writing updated data to the SQlite database on Android.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bromzh, 2015-04-07
@dandewine

In fact, there is some ambiguity here. Here is the problem and possible solutions. In a nutshell: everything is limited by disk speed. Insert is fast (50 thousand operations per second), but transactions are slow (60 per second). If you insert a bunch of inserts into one transaction (via BEGIN...COMMIT ) - it will be fast. You can also do PRAGMA synchronous=OFF , then sqlite will not wait for write confirmation. But in this case, when the power is turned off, all unsaved data will be lost.
Also read this:
tech.vg.no/2011/04/04/speeding-up-sqlite-insert-op...
dba.stackexchange.com/questions/8028/whats-better-...
stackoverflow.com/questions /1271641/in-sql-is-upda...

I
IceJOKER, 2015-04-05
@IceJOKER

And what do you think - two standard queries will run faster or one?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question