This might be a bit like asking how long a length of string is, but the stats are:
my_index
(my_column);Order of magnitude, should it be 1 minute, 10 minutes, 100 minutes?
Thanks
Edit: OK it took 2 hours 37 minutes, compared to 0 hours 33 mins on a lesser spec machine, with essentially identical set ups. I've no idea why it took so much longer. The only possibility is that the prod machine HD is 85% full, with 100GB free. Should be enough, but i guess it depends on how that free space is distributed.
If index is relatively wide - it can take from minutes to hours. if you have your DB on Enterprise Edition of Sql Server, than you can choose to create an index WITH ONLINE=ON - it will take a little bit more time and space to complete, but will not stop other processing with the table involved
MySQL ALTER TABLE Statement The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. The ALTER TABLE statement is also used to add and drop various constraints on an existing table. ALTER TABLE - ADD Column
Things like total size of the table, data types, what the index was that you created. Those things can also impact the creation time. Run the script from the following link and post the results for the table in question. Also post things like the table definition and index definition please.
Currently, the index rebuild for this big table is taking 4 hours (half of the total time for full database index rebuild) I am trying to balance the cost and benefit here.
If you are just adding the single index, it should take about 10 minutes. However, it will take 100 minutes or more if you don't have that index file in memory.
Your 200 varchar with 8 million rows will take a maximum of 1.6GB, but with all of the indexing overhead it will take about 2-3 GB. But it will take less if most of the rows are less than 200 characters. (You might want to do a select sum(length(my_column))
to see how much space is required.)
You want to edit your /etc/mysql/my.cnf
file. Play with these settings;
myisam_sort_buffer_size = 100M
sort_buffer_size = 100M
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With