Will adding an index to a table of 2 million records be twice as slow as adding to an index with 1 million records?

I have a table with 70 million records and no index. I want to calculate the time to add an index without backing up the table and doing the index in the backup table.

I'm just wondering if it will be twice as slow (linear) or if it is exponential.

: mysql 5.0

Thank you so much

+5
source share
2 answers

(Disclaimer: I have minimal experience with MySQL)

It should be somewhere in between.

, , - O(n). -, - , , .

SQL B-. O(log(n)), n - . n O(n log(n)). O(n log(n)).

, . , , node, , O(1) : .

, , , . , , . , , O(n log(n)) - ...

.

EDIT:

, 70 000 000 B-, , . , . INTEGER , , , TEXT - . 100 (, HTTP- 30 UTF-8), 7 .

:

  • , , DB, / , , itelse .

  • , , - .

+4

, thkala , , RDBMS n, , . IO.

, : , .

+1

All Articles