I'm trying to insert about 60 000 rows on my database on localhost (windows) it is now taking about an hour and still inserting. Shouldn't it be faster? INSERT INTO ip2nation (ip, country) VALUES (687865856, 'za'), (689963008, 'eg'), (691011584, 'za'), (691617792, 'zw'), (691621888, 'lr'), (691625984, 'ke'), (691630080, 'za'), (691631104, 'gh'), (691632128, 'ng'), (691633152, 'zw'), (691634176, 'za'), (691650560, 'gh'), ... Code (markup):
You are doing about 16 inserts a second. That is pretty fast. Are you running any anti-virus programs? If so, did you try disabling it? I had to backup some files yesterday and after I disabled anti-virus it went faster.
You might be better of providing the DB structure, including the type of storage engine you are using. There might be ways to improve this and speed up the inserts.
Hi, if you doing by Manual, its based on Internet connection and server you are using. if you using Dedicated server, you can use mysqldump import -> it may take only 1 min so Thanks
it also depends what indexes you have setup on the database itself, and how many existing records, as this slows down the INSERT a lot. I tried inserting 130 million records in 4 separate batches the other day into an empty table and only the first file was quick, probably because of the indexing i was doing. So I combined the 4 files into 1 and then did the insert and it finished in less than 2 hours.
when your inserting data in tables, many things run behind the scenes, I should know the table structure and what kind of indexes are applied on it. The Indexes are one of the main causes of performance. If used well they are lightning fast if not they spoil the performance. btw, hardware (or resources) play a vital role.
Did it finish yet? It really all depends on your system, disk IO, etc. 60,000 2 column rows shouldn't take too long.