SQL query time complexity

What is the time complexity of simple SQL statements such as:

INSERT into table (col1, col2, col3) values ("a", "b", "c")

How it depends on the following:

  • table size
  • data type col1, col2
  • the number of columns in the table, namely: col1, col2, col3, etc.

It depends on me whether I use MyISAM or InnoDB?

+5
source share
1 answer

The MySQL 5.0 documentation has a nice page in this thread .

The article gives approximate proportional costs for each of the subtasks involved in the insertion task.

The time required to insert a line is determined by the following factors, where the numbers indicate approximate proportions:

Connection: (3)

Sending a request to the server: (2)

Request Analysis: (2)

: (1 × )

: (1 × )

: (1)

, .

log N, B-.

, , .

+6

All Articles