Connect

Discussions

Members

Resources

Events

 View Only
  • 1.  Modifying or dropping target indexes during active replication in Connect CDC

    Employee
    Posted 08-11-2026 19:57
    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?


    ------------------------------
    Adhitya Maya
    *Precisely Software Inc.
    ------------------------------


  • 2.  RE: Modifying or dropping target indexes during active replication in Connect CDC

    Employee
    Posted 08-12-2026 00:51
    Edited by Sathya LJK 08-12-2026 00:51

    Good point. I think the model synchronization part is especially important here. A manual index change may work fine during normal replication, but it can become noticeable later during a COPY if the committed model still has the old definition. I would also check the distribution key and any existing replication backlog before making the change.



    ------------------------------
    Sathya LJK
    *Precisely Software Inc.
    ------------------------------



  • 3.  RE: Modifying or dropping target indexes during active replication in Connect CDC

    Employee
    Posted 12 days ago
    A key point here is ensuring the CDC model remains aligned with any database changes. While index modifications typically do not impact active replication, changes to unique indexes or distribution key-related indexes can have unexpected effects during COPY operations or collision handling. Refreshing table definitions and validating model synchronisation beforehand can help avoid surprises later. Great insight!


    ------------------------------
    Neha Goel
    *Precisely Software Inc.
    ------------------------------