MYSQL Question

Status
Not open for further replies.

Webferret

Banned
Jun 18, 2007
1,257
10
0
table with 4.5 million records. Mac OSX 2.16 GHz Intel core 2, 1 gig 667 mhz ddr2 ram.

want to add a new index to the table, 2 fields (both integers).

anyone got any idea how long that will take? It's been running 12 hours so far....
 


4.5 millions records is a lot, but 12 hours doesn't seem right. Then again if it ended after 12 hours you where updating 6250 records a minute, which is quite a lot, so give it another 6 hours and report back.
 
It depends on the structure of your table and the complexity of your index. But 12 hours seems VERY long. Be carefull though. I stopped a server once while it was still adding an index and lost a lot of data.
 
thx guys. I've killed it in the end. it seems happier scanning the entire table than adding the index, so seeing as its a one off set of qrys I'll stick with that.
 
It might be faster to create a new empty table with the same structure and the indexes added and then copy the records from the original table into the new table.
 
Must've been way too big to fit in memory so it was doing a lot of disk swapping on a slow disk. That'd be the only thing to slow it down that much. Copying the data would be much faster since, with the right configuration settings, you can write thousands of rows to memory then it'll flush them to disk all at once.
 
Status
Not open for further replies.