What I ran into
I was looking at whether it is safe to change or drop indexes on a target table while Connect CDC replication is running. The short answer is yes, but there are a few cases where it can behave differently than expected.
What generally happens
In most cases, modifying or dropping indexes on the target side does not directly break CDC replication. CDC continues applying inserts, updates, deletes, and commits as usual.
The main impact is indirect, especially around performance or how the database handles locks during the change.
Where issues can show up
1. Copy and synchronization behavior
During a COPY or the copy phase of synchronization:
- CDC drops indexes at the start of the load
- Recreates them at the end
The important detail is this:
Indexes are recreated based on the last committed model definition, not the current database state.
If indexes were changed manually in the database but the model was not refreshed:
- CDC may rebuild them with old definitions
- Result can be unexpected index structure after the load
What helped me here was refreshing table definitions in Director and committing the model before running the next COPY.
2. Unique index and collision handling
This is the one that surprised me.
CDC relies on the distribution key for collision detection and resolution.
By default, this often maps to the primary key or a unique index.
If you modify or drop a unique index:
- You might introduce collisions that did not exist before
- Collision resolution behavior can change
- If the distribution key is no longer aligned, CDC may struggle to resolve conflicts properly
This is less about the index itself and more about what it represents in the model.
3. Locking during index operations
If dropping or altering an index takes time:
- The target table may be locked
- CDC applies may be temporarily blocked
This is not CDC-specific but shows up as replication lag or delay.
What I check before making index changes
- Whether the index is tied to a distribution key
- Whether a COPY operation is planned soon
- If the model definitions are in sync with the database
I also use the Catalog Synchronization Report to confirm if anything is out of sync before running operations.
Takeaway
Changing indexes during replication is usually safe, but the risk comes from model mismatch and collision handling changes.
For me, the key lesson was:
Indexes are not just database objects in CDC. They are part of how the system understands and resolves data.
Have you ever changed an index and later realized CDC behaved differently than expected?
*Precisely Software Inc.