I have a table of about 100M rows that I am going to copy to alter, adding an index. I\'m not so concerned with the time it takes to create the new table, but will the crea
This doesn't matter on this problem because:
O(n*log(N))
longer (where n
is a rows added). Because tree gerating time is O(N*log(N))
then if you split this into old data and new data you get O((X+n)*log(N))
this can be simply converted to O(X*log(N) + n*log(N))
and in this format you can simply see what you will wait additional.n
new rows) you get longer insert additional time O(log(N))
needed to regenerate structure of the tree after adding new element into it (index column from new row, because index already exists and new row was added then index must be regenerated to balanced structure, this cost O(log(P))
where P
is a index power [elements in index]). You have n
new rows then finally you have n * O(log(N))
then O(n*log(N))
summary additional time.