Availability groups and large batch operations

  • We just switched over to 2014 with AG, from SQL 2008. So far, its wonderful, things are running along as usual, but.... (there is always a but)

    I have this job that calls some rather large MERGE statements to do updates and inserts and it just hangs unless the data movement to the secondary is suspended while it runs.

    I've already adjusted indexing and made sure the MERGE only works on the records that actually need updating or inserting, but this problem has me scratching my head a bit.

    In general, would it be better to scrap the existing logic and re tool it with separate update and insert statements?

  • Manic Star (12/8/2015)


    We just switched over to 2014 with AG, from SQL 2008. So far, its wonderful, things are running along as usual, but.... (there is always a but)

    I have this job that calls some rather large MERGE statements to do updates and inserts and it just hangs unless the data movement to the secondary is suspended while it runs.

    I've already adjusted indexing and made sure the MERGE only works on the records that actually need updating or inserting, but this problem has me scratching my head a bit.

    In general, would it be better to scrap the existing logic and re tool it with separate update and insert statements?

    is the secondary a synchronous or asynchronous replica

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Synchronous

  • We added steps to suspend the data sync until the merges finish, then restart it.

    Not pretty, but for now it works.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply