Should I reset the table index / optimize after deleting many rows?

I have a table with 1,000,000 records, and I run an instruction that deletes ~ 700 thousand rows. The auto increment index, of course, is 1,000.001. The highest primary key is subsequently, for example, 40,000.

After such a huge row deletion, should I manually set the index to 40,001 or optimize the table in some way? Or does MySQL not care about this huge gap when inserting new rows and using the index in select operations after (in terms of speed)?

+3
source share
2 answers

The MySQL manual says:

OPTIMIZE TABLE ,

reset , . INT () 1M.

, , 1 000 000 1 000 000 000.

+2

OPTIMIZE TABLE, MySQL , / , . ? , OPTIMIZE TABLE , .

+1

Source: https://habr.com/ru/post/1789995/


All Articles