Solved

Can't write indexes to table

Posted on 2014-10-06
6
614 Views
Last Modified: 2014-10-06
I'm using SQLyog and attempting to add an index to a table that consists of over 250,000,000 rows.

When I run this code:

ALTER TABLE Verizon ADD INDEX ( geo_coords_0 );

It runs for a little bit, but then I get this error:

Error Code: 1878
Temporary file write failure
(205999 ms taken)

Not sure how to proceed. Perhaps there's a timeout setting that I need to adjust? What do you think?

Thanks!
0
Comment
Question by:brucegust
  • 4
  • 2
6 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
ID: 40364607
I think you need more space on your server. How big is this table and how much free space does the MySQL database have available for its use?

Edit: Doing some guesstimates I estimate that each index needs between 1 to 2 GB of space for 250 million rows
0
 

Author Comment

by:brucegust
ID: 40364619
283,000,000 rows and I don't know about free space, although I'm thinking in light of the company I'm working for, there should be plenty of room.
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 40364635
"Temporary file write failure" is what is says - an inability to write. That suggests either permissions or space to me. I cannot see it as being permissions as the MySQL database rarely has permission problems once it is up and running. That suggests space to me.

What OS are you running under?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:brucegust
ID: 40364640
Beverley, I think I've figured out the problem. I ran the exact same command, as far as adding an index, on a table with the same structure, but with fewer rows (500,000,000). It ran no problem.

That being the case, I think I'm going to create a new table with the indexes already in place and then move records over to that new table from the other one incrementally.

Thanks for your input!
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 40364655
"Alter table" creates a copy of the table in the same folder as the original table. It means that for a certain period you will need as much free space as the original table. For nearly 300 million rows I am guessing you will need a few GB spare (35GB or thereabouts).

Creating a new table with indexes may not solve the problem unless you delete records from one table when you have safely moved them to the other table. Look at the filesize for the current table and then compare that with the amount of free space available.
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 40364665
Hi,

I just noticed that you accepted the solution whilst I was typing my previous reply. Good luck with it all and thanks for the points.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now