Shangwei Wang
11/23/2022, 11:54 PM0.40.18
• postgres source version - 1.0.23
• redshift destination version - 0.3.51
1. We use “incremental dedup” for 2 tables (postgres -> redshift). When i was examine the queries in the log, i noticed that one query has updatedAt >= ? while the other uses updatedAt > ?, the difference is the presence of =. Intuitively, i thought all incremental queries should be without the =? Whats the deciding factor for adding/omitting the = sign? _update_: i just found some doc on this, our updatedAt timestamp for both tables are down to the millisecond resolution, so I’m not sure why there is a difference in the query…
2. The one query that has the = sign, the connection state has cursor_record_count = 333
a. what does “cursor count” represent in airbyte?
b. is this normal?
Thanks a bunch, and happy holidays!Alex Marquardt (Airbyte)
11/24/2022, 9:50 AMAlex Marquardt (Airbyte)
11/24/2022, 9:55 AM> could result in some records not being selected - i.e. if 1000 records come in with a timestamp of X (same time for all), but the SELECT were to run after only half (500) had been committed to the source, then the subsequent 500 would be missed in the next sync run.Shangwei Wang
11/24/2022, 5:43 PM> for one table and >= for the other in the same connection? by that edge case logic, everything should be > then? Apologies if i overlook something in those docs.Alex Marquardt (Airbyte)
11/25/2022, 9:01 AMThe problem of using >= is that if there is no new data, the rows with the cursor value will be duplicated each time. If a connector is scheduled to run every 30 minutes, that's 48x duplications per day. This experience seems pretty bad to me. If I see this in my data syncing tool, I would definitely look for other vendors. More importantly, it is possible that there may be a ton of data with the same cursor value. For example, the cursor is the creation date, and 1 million rows are generated programmatically with the same creation date. Under those scenarios, duplication should be avoided as much as possible.
The solution I am currently implementing is to use > by default, and use >= when needed. The idea is to track the number of rows synced together with the cursor value. So the state looks something like { users: { count: 3, cursor: "2022-01-03 00:00:00"}}. Each time before the incremental sync, count the number of rows with cursorColumn = cursorValue. If the result is different from the one in the state, we know there are changes, and use >= for the incremental query. Otherwise, use > to avoid the duplication.Shangwei Wang
11/26/2022, 12:37 AM