Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the time complexity of INSERT, UPDATE and SELECT in SQLite?

I am developing an android application and using SQLite. I wonder that:

  • What is the time complexity of INSERT, UPDATE and SELECT operations. (I would be happy if the answer will be in terms of BigO notation but other answers are also welcome.)

  • What is the CPU usage?

like image 434
abidinberkay Avatar asked Nov 03 '22 00:11

abidinberkay


1 Answers

Both questions are really too vague to answer, but this may help:

Time Complexity:

Given a particular SQL statement you could perhaps figure the time and complexity, but there are simply too many factors to point to a single answer.

You might be interested in EXPLAIN QUERY PLAN which can help you with particular SELECTs.

CPU Usage:

Again, CPU usage of what exactly? Complex queries may hit the CPU a bit more, but I think you'll find most of the work is I/O.

like image 95
NuSkooler Avatar answered Nov 10 '22 18:11

NuSkooler