Normalization in Postgres destination does not perform well, incremental run is too slow

  • Is this your first time deploying Airbyte?: No
  • OS Version / Instance: Ubuntu
  • Memory / Disk: 32GB / 1 TB
  • Deployment: Docker
  • Airbyte Version: 0.40.26
  • Source name/version: Postgres 1.0.34
  • Destination name/version: Postgres 0.3.26
  • Step: The issue is happening during sync in normalization phase
  • Description: 2nd run of incremental sync is terribly long for large tables because of Basic normalization

we’ve got a problem with basic normalization after an incremental load on Postgres2Postgres sync (append incremental).
We’re loading quite large tables, around 150GB and 450 millions of rows, first sync lasts almost 24 hours and normalization takes a few hours of it. That’s expected.
But now, 2nd incremental load contains just 300.000 rows, Extract/Load is done within a minute, and normalization then freezes, not fininshing within a day!

I looked into the code and normalization SQL contains this condition:

and coalesce(
    cast(_airbyte_emitted_at as
    timestamp with time zone
) >= (select max(cast(_airbyte_emitted_at as
    timestamp with time zone
)) from "dwh_db".mining."reward"),

Is it possible that it is a bug and condition should filter only new records using ‘>’ ?
It seems to me that this code replicate all already synced rows to normalization again, causing repeated rework for our 450 GB of data.

Hello there! You are receiving this message because none of your fellow community members has stepped in to respond to your topic post. (If you are a community member and you are reading this response, feel free to jump in if you have the answer!) As a result, the Community Assistance Team has been made aware of this topic and will be investigating and responding as quickly as possible.
Some important considerations that will help your to get your issue solved faster:

  • It is best to use our topic creation template; if you haven’t yet, we recommend posting a followup with the requested information. With that information the team will be able to more quickly search for similar issues with connectors and the platform and troubleshoot more quickly your specific question or problem.
  • Make sure to upload the complete log file; a common investigation roadblock is that sometimes the error for the issue happens well before the problem is surfaced to the user, and so having the tail of the log is less useful than having the whole log to scan through.
  • Be as descriptive and specific as possible; when investigating it is extremely valuable to know what steps were taken to encounter the issue, what version of connector / platform / Java / Python / docker / k8s was used, etc. The more context supplied, the quicker the investigation can start on your topic and the faster we can drive towards an answer.
  • We in the Community Assistance Team are glad you’ve made yourself part of our community, and we’ll do our best to answer your questions and resolve the problems as quickly as possible. Expect to hear from a specific team member as soon as possible.

Thank you for your time and attention.
The Community Assistance Team