844-NOGALIS (844-664-2547)
Nogalis, Inc.
  • Link to Facebook
  • Link to X
  • Link to LinkedIn
  • Link to Mail
  • Company
    • News, Events and Articles
    • About Us
  • Products
    • Infor Lawson Data Archive
    • PeopleSoft Data Archive
    • Oracle Data Archive
  • Services
    • Infor Lawson Support
    • Infor Lawson / CloudSuite Consulting
  • Education & Training
  • Support
  • Contact Us
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

Reclaiming Space for Truncated Aurora MySQL Tables

Articles, Frontpage Article, News

When working with Aurora MySQL, it’s common to assume that running a TRUNCATE TABLE will completely clear out space and return your database to its pre-load size. Unfortunately, that’s not quite how it works — and it often surprises people during large migrations.

Here’s why truncating doesn’t always free space, and what you should do instead.

TRUNCATE vs. Space Reclamation

In MySQL (and Aurora MySQL), TRUNCATE TABLE is a fast operation that:

  • Deletes all rows from a table.
  • Resets the auto-increment counter.
  • Removes and recreates the underlying table definition internally.

However, with InnoDB tables, the physical storage file is not always shrunk automatically. Instead:

  • Pages inside the tablespace are marked as free.
  • The file size on disk (or Aurora’s volume usage) often stays the same.

That means your database volume won’t shrink even if the table is empty.

The Role of OPTIMIZE TABLE

To actually reclaim space after large deletes or truncations, you need to run:

OPTIMIZE TABLE your_table;

What this does:

  • Creates a new copy of the table with active rows.
  • Rebuilds indexes.
  • Frees up unused pages and defragments data.
  • Releases the unused space back to Aurora’s volume.

In practice, many users see 20–40% of their allocated storage reclaimed after running OPTIMIZE TABLE on heavily churned datasets.

Aurora-Specific Gotchas

  1. Shared Storage Model
    Aurora uses a distributed storage layer, so file-per-table semantics can be a bit confusing. Even with innodb_file_per_table=ON, the space isn’t automatically released at the cluster volume level until the table is rebuilt.
  2. Performance Impact
    • OPTIMIZE TABLE is blocking for writes and can run for minutes to hours on very large tables.
    • Plan downtime or run during low-traffic windows.
  3. Monitoring
    Watch the VolumeBytesUsed CloudWatch metric before and after running OPTIMIZE. If you only truncate, the metric won’t move. After optimize, you’ll see a real decrease.

Best Practices

  • For staging or migrations: Always follow TRUNCATE with OPTIMIZE TABLE to reclaim disk space.
  • For production: Schedule optimizations for off-peak hours, and test on smaller tables first.
  • For ongoing operations: If your workload does lots of churn (bulk loads/deletes), regular optimization may be necessary.

Final Takeaway

In Aurora MySQL, TRUNCATE TABLE clears rows but doesn’t guarantee space reclamation. To actually shrink your database footprint, you need to rebuild the table with OPTIMIZE TABLE. Think of it as the “vacuum” step — without it, your cluster will keep carrying dead weight.

Retiring Lawson, PeopleSoft, or Oracle? APIX archives the entire application — every table, every year, attachments and security included — into your own AWS account in about 30 days, so you can decommission the legacy system and keep full access to the history.

See how the APIX ERP archive works →

03/03/2026
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://www.nogalis.com/wp-content/uploads/2026/03/Reclaiming-Space-for-Truncated-Aurora-MySQL-Tables.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-03-03 08:37:222026-03-02 12:40:47Reclaiming Space for Truncated Aurora MySQL Tables

LEGACY ERP DATA ARCHIVE SOLUTION



Discover how our clients are leveraging AWS services to archive their Legacy ERP data and provide ubiquitous access to users via a light-weight, secure, and read-only web interface. Secure, Fast, Reliable, and Cost Effective. That is the promise of APIX. Follow the link below to find out more and book a discovery call with our data archive specialist.

BOOK DEMO

© Copyright - Nogalis, Inc. 2026
  • Legal
  • Privacy
  • Contact Us
Link to: AI in Cloud ERP (2026): How Intelligent ERP Is Redefining Modern Enterprises Link to: AI in Cloud ERP (2026): How Intelligent ERP Is Redefining Modern Enterprises AI in Cloud ERP (2026): How Intelligent ERP Is Redefining Modern Enterprise... Link to: How To Build Adaptable ERPs Link to: How To Build Adaptable ERPs How To Build Adaptable ERPs
Scroll to top Scroll to top Scroll to top