M
M
melnikov_m2017-07-04 10:34:26
MySQL
melnikov_m, 2017-07-04 10:34:26

What is the correct way to build a new index on a large table?

There is a big table, more than 15 million records. Building a new composite index from 3 fields took more than an hour in the "copy to tmp table" stage, after which I got tired of waiting, I realized that it was a bad job and canceled the process)
Are there any recommendations to speed up this process? change some server settings or something like that?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fortop, 2017-07-04
@melnikov_m

The question has already been repeatedly raised
The general principle of updating the structure of large or loaded tables.
It concerns both indexes and adding/removing columns
https://toster.ru/answer?answer_id=1023774#answers...
Clarification.
For indexes, it will be faster to turn them off first, insert all the data. And only then create indexes

S
Swartalf, 2017-07-04
@Swartalf

It won't be faster, but without a global lock on the base.
For example, I added an index to a table of ~ 30Gb or 40 million records, it took about an hour

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question