<@U04S8PLJWMT> There is one airbyte_internal schem...
# ask-ai
j
@kapa.ai There is one airbyte_internal schema table in postgres that is 11GB, far larger than any other table in the database. What can be safely be done about this while also keeping the incremental append and deduped sync mode?
k
Short answer: that large table is expected. In Incremental | Append and Incremental | Append + Deduped, Airbyte writes all incoming records to “raw” tables in the airbyte_internal schema and does not update them in place. This makes raw tables grow monotonically and can be much larger than the final, deduped tables (storage overhead is a known trade‑off) ([Incremental Append – behavior and cleanup note](https://docs.airbyte.com/platform/next/using-airbyte/core-concepts/sync-modes/incremental-append#finding-the-latest-snapshot-of-data); [Postgres destination schema map (raw tables)](https://docs.airbyte.com/integrations/destinations/postgres#schema-map)). There isn’t documented automatic truncation/compaction of raw tables, and users have reported duplication/size growth in raw tables over time ([issue report](https://github.com/airbytehq/airbyte/issues/62501)). What you can safely do, while keeping Incremental | Append + Deduped: - Keep using Incremental | Append + Deduped for your final tables to have only the latest row per primary key in the final tables ([Incremental Append + Deduped overview](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped)). - Plan periodic housekeeping of raw tables outside of Airbyte. The docs suggest you can “periodically run cleanup jobs which retain only the latest instance of each record” for Append scenarios; the same idea applies to controlling raw table growth. Be careful to keep rows needed for state/normalization, but the documentation does not provide an official procedure, so proceed cautiously and test before pruning ([Incremental Append – cleanup note](https://docs.airbyte.com/platform/next/using-airbyte/core-concepts/sync-modes/incremental-append#finding-the-latest-snapshot-of-data)). - If you only need the latest snapshot and want smaller storage, prefer Incremental | Append + Deduped over plain Append. It keeps final tables deduped; however, raw tables will still accumulate unless you clean them up yourself ([Incremental Append + Deduped](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped); [Postgres raw tables design](https://docs.airbyte.com/integrations/destinations/postgres#schema-map)). Limitations/uncertainty: - The knowledge sources do not provide an official, supported procedure to purge or compact airbyte_internal raw tables, nor a config to auto‑prune them. Users have requested improvements and highlighted storage bloat in raw tables ([issue report](https://github.com/airbytehq/airbyte/issues/62501)).
j
@kapa.ai how many rows of data in the raw table do I need to keep in order to not break the incremental append and deduped sync mode?
k
A message from kapa.ai
I’m sorry, but the knowledge sources do not specify any supported minimum/retention rule for how many rows must be kept in raw (airbyte_internal) tables to preserve Incremental | Append + Deduped behavior. Airbyte’s design appends all versions to raw/history tables and does not document an official compaction or truncation procedure; raw tables are expected to grow and may contain many duplicates over time ([Incremental sync behavior](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-modes/incremental-append-deduped); [tutorial notes on raw/history growth and deletions not being propagated](https://airbyte.com/tutorials/incremental-data-synchronization#step-7); [reported raw-table growth](https://github.com/airbytehq/airbyte/issues/62501)). Practically, any pruning policy risks dropping records that normalization/dedup or state recovery may rely on. Since there’s no documented safe threshold, the safest documented guidance is to retain the raw tables as-is, or test any cleanup strategy thoroughly in a non‑prod environment before applying it in production ([limitations and caveats](https://airbyte.com/tutorials/incremental-data-synchronization#step-3)).