?
Solved

Can't write indexes to table

Posted on 2014-10-06
6
Medium Priority
?
707 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 2000 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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