How to open a large SQL dump file on Mac (without a crash)

You double-click a 20–50 GB .sql export and your editor spins, freezes, then dies. You can't even open the file — never mind remove a single bloated table. Here's why editors choke, the command-line workarounds, and a faster way.

A production database dump can easily reach tens of gigabytes. The moment you try to open it in a normal text editor, your Mac's fan spins up, the beachball appears, and eventually the app quits — sometimes taking unsaved work in other windows with it.

Why editors choke on large dumps

VS Code, TextEdit, Sublime Text and friends are designed to load the entire file into memory so they can scroll, search and highlight instantly. That's fine for a 2 MB source file. For a 40 GB dump it means the editor tries to allocate 40 GB (plus overhead for its internal data structures) in RAM.

Your Mac has 16 or 32 GB. Long before the file is fully loaded, the system runs out of physical memory, starts swapping to disk, and grinds to a halt. Most editors also refuse outright: VS Code caps files at around 50 MB for the full editor and drops into a stripped-down mode, TextEdit simply hangs, and Sublime allocates until it crashes. Even if you get the file open, syntax highlighting and search will re-scan gigabytes on every keystroke.

The core problem: these tools assume random access to the whole document. A dump doesn't need that — it's a sequential list of statements. You only need to stream through it.

The command-line way

The Unix tools on your Mac already stream, so they never load the whole file. They're the classic first resort:

# Peek at the first and last lines without opening the whole file
head -n 50 dump.sql
tail -n 50 dump.sql

# Split the dump into 100 MB chunks named part_aa, part_ab, ...
split -b 100m dump.sql part_

# Pull out one table's block between two markers
sed -n '/CREATE TABLE `users`/,/UNLOCK TABLES/p' dump.sql > users.sql

This works, but it's fragile and tedious. split -b cuts on raw byte boundaries, so it will slice straight through the middle of an INSERT statement — the resulting chunks aren't valid SQL on their own. The sed range trick depends on the exact markers a specific dump tool happens to emit; change the MySQL version or switch to PostgreSQL and the pattern no longer matches. And none of it gives you a view of what's actually in the file — you're guessing which table is the 30 GB one before you can even target it.

Open and filter it with DumpCleaner

DumpCleaner was built for exactly this file size. It streams the dump the way the command line does, but it understands SQL structure, so you get a real table list and safe, statement-aware output:

  1. Drag the file in. DumpCleaner opens the dump by streaming it in ~1 MB chunks — a 50 GB file opens with roughly 50 MB of RAM, so nothing freezes.
  2. See every table. It scans the dump and lists each table with its size, so you immediately spot which one is bloating the file.
  3. Deselect what you don't need. Untick the giant log, session or analytics tables. DumpCleaner keeps whole statements intact — no half-cut INSERTs.
  4. Export. Write a new, smaller .sql file that finally opens and imports comfortably. Your original file is never modified.

Because it processes 50 GB and larger dumps with constant memory, you don't have to think about your Mac's RAM at all. And since it reads the source and writes a separate output, the dump you started with stays exactly as it was.

Open dumps your editor can't

DumpCleaner streams SQL dumps of any size with constant memory — no crash, no swap, no waiting. Drag in a 50 GB file, drop the tables you don't need, export a smaller one. Native macOS & iPadOS app, one-time purchase.

Download on the App Store

Frequently asked questions

How large a SQL dump can DumpCleaner handle?

There's no fixed limit. It processes the file as a stream in small chunks, so 50 GB and larger dumps work like small ones — the size is bounded by your disk, not your RAM.

Does DumpCleaner load the whole file into RAM?

No. Unlike a text editor, it reads the dump in small chunks and keeps memory roughly constant at around 50 MB, whether the file is 200 MB or 50 GB.

Can I split a dump by table?

Yes. Instead of split cutting blindly on byte boundaries, DumpCleaner understands table structure. Deselect the tables you don't want and export a clean file with only the ones you keep.

Does DumpCleaner modify my original file?

No. The source dump is only read — DumpCleaner always writes a new file, so your original stays untouched.

Stop fighting your editor

Drag in the huge dump, drop the tables you don't need, export a file that actually opens. DumpCleaner handles any size with constant memory.

Download on the App Store