---
title: "Optimizing Redshift Write Patterns: Tackling Tombstones and Ghost Rows"
description: "Repeated DELETE FROM + COPY snapshot reloads in Amazon Redshift left some tables with up to 90% ghost rows, about 22 billion rows on disk for 2.4 billion live ones."
url: "https://swe.quest/articles/optimizing-redshift-write-patterns-tackling-tombstones-and-ghost-rows-0fcf77762d2bfabb"
canonical: "https://eng.wealthfront.com/2026/08/24/optimizing-redshift-write-patterns-tackling-tombstones-and-ghost-rows/"
source: "Wealthfront Engineering"
published: "2026-08-24"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["analytics","storage-engines","data-pipelines","performance","sql"]
---

# Optimizing Redshift Write Patterns: Tackling Tombstones and Ghost Rows

A post on [Wealthfront Engineering](https://swe.quest/sources/wealthfront.md), published 2026-08-24, 8 min read, Case study. Original: [https://eng.wealthfront.com/2026/08/24/optimizing-redshift-write-patterns-tackling-tombstones-and-ghost-rows/](https://eng.wealthfront.com/2026/08/24/optimizing-redshift-write-patterns-tackling-tombstones-and-ghost-rows/)

## Summary

Repeated DELETE FROM + COPY snapshot reloads in Amazon Redshift left some tables with up to 90% ghost rows, about 22 billion rows on disk for 2.4 billion live ones. VACUUM could not reclaim the space because it frees only whole 1 MB blocks, and live and deleted rows were interleaved across most blocks. Wealthfront fixed bloated tables with deep copies as a stop-gap, then moved to two write patterns. Tables with dependent views use TRUNCATE + ALTER TABLE APPEND FROM, which requires pinning an explicit diststyle. All other tables use a staging-table load followed by an atomic rename swap, which keeps AUTO diststyle. Storage dropped 2-10x, and one multi-terabyte load fell from over 5 hours to about 1 hour.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

- SQL DDL and transactions ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- data warehouse basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- columnar storage concepts

## Keywords

Amazon Redshift, VACUUM, ALTER TABLE APPEND, TRUNCATE, AUTO diststyle, deep copy

## Related posts

- [Postgres Bloat Minimization](https://swe.quest/articles/postgres-bloat-minimization-4680de201e2c3adb.md): Supabase · 2024-04-26 · Medium · 6 min read · PostgreSQL, Storage engines, Performance engineering
  Postgres stores table rows in 8KB heap pages and writes a new row version on every update, so dead versions accumulate until vacuum reclaims them and updates the free-space and visibility maps.
- [Vantage's Journey from Redshift and Postgres to ClickHouse](https://swe.quest/articles/vantage-s-journey-from-redshift-and-postgres-to-clickhouse-3bbe2f8581aa24cf.md): ClickHouse · 2023-07-13 · Easy · 5 min read · Analytics & OLAP, PostgreSQL, Databases, Cost optimization
  Vantage, a cloud cost platform handling billions of billing records, outgrew Postgres when constant deletes and reinserts kept vacuum running and pushed indexes out of memory.
- [Post mortem on Linear incident from Jan 24th, 2024](https://swe.quest/articles/post-mortem-on-linear-incident-from-jan-24th-2024-c1bcc35cc14b559c.md): Linear · 2024-01-30 · Medium · 9 min read · Incidents & postmortems, PostgreSQL, Schema migrations, Local-first & sync
  A database migration using \`TRUNCATE TABLE ... CASCADE\` on two new, unused tables silently wiped every production table with foreign keys to them, including issue and document descriptions, comments, notifications and reactions.
- [I don't trust ON DELETE CASCADE](https://swe.quest/articles/i-don-t-trust-on-delete-cascade-44280f7ae72c78f6.md): PlanetScale · 2026-10-21 · Medium · 5 min read · PostgreSQL, Schema migrations, Replication, Databases
  Postgres ON DELETE CASCADE turns a single-row delete into an unbounded transaction that can cause outages at scale.
- [Improving Parquet Dedupe on Hugging Face Hub](https://swe.quest/articles/improving-parquet-dedupe-on-hugging-face-hub-fceac01ac834bf66.md): Hugging Face · 2024-10-05 · Medium · 5 min read · Storage systems, Analytics & OLAP, Data pipelines, Algorithms
  Byte-level content-defined chunking dedupes Parquet appends almost perfectly: 10,000 appended rows give 99.1% dedupe and need about 20MB of new storage.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
