Out of disk space while dropping columns from a mysql table



  • So, my setup is a little weird. I've got a laptop with 250 GB of memory and a table with roughly 100 million rows (InnoDB), which occupies around 130 GB of memory. The thing is, this table includes too many redundant columns which are not required anymore. But somehow during the drop operation I'm suddenly out of disk space. I assume that in order to drop the columns, InnoDB just copies the table in order to swap it with a new one without these columns. So, in effect, I can't delete the columns. But I'd love too. However, I've got an external drive. But Mysql Workbench export wizard won't allow me to export the table to the external drive, in effect it still creates a copy on my local drive, which make my computer run out of memory. I assume it will move the resulting file to the external drive, but it can't happen because of the memory limitations. What's the best strategy in these circumstances?



  • I was able to resolve my own issue I select into outfile'ed my database to the external drive, truncated it, dropped columns and reloaded the outfile back.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2