Secondary replica and stored procedure

  • This was removed by the editor as SPAM

  • Tried with temp table and maxdop option in query and it didn't resolve the issue. Wonder changing the CTP would help?

  • Admingod wrote:

    Actually we have a database which is not part of availability group and it's reading the data from secondary replica and inserting into the database which is not a part of AG group. Based on execution plan the Est cost I noticed is when it is inserting rows into that database. How can you improve the performance?

    Improving performance on an INSERT is frequently a question of hardware. There are a few tricks you can try. Change the fill factor on the index so that more of the page is free so you get fewer page splits on INSERT can help in some situations. I'd look first at the execution plan, see what work is being done.  Are there referential integrity checks? Are they optimized so that they're using an index or are they doing scans? Break down the transactions into smaller chunks so there's possibly less blocking & resource contention. Stuff like that. Otherwise, bigger, faster, more disks and disk controllers.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Admingod wrote:

    Tried with temp table and maxdop option in query and it didn't resolve the issue. Wonder changing the CTP would help?

    With utterly incomplete information, not seeing the query, structures and execution plan, there's no suggestion I can make really. Seems like you're poking buttons hoping one of them will be a magic "run faster" switch. I assure you, there isn't one. It's always about getting the code right, the structures right, keeping the statistics updated, all the dull work (well, I actually love it).

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Admingod wrote:

    Tried with temp table and maxdop option in query and it didn't resolve the issue. Wonder changing the CTP would help?

    Sure. Go for it.

    Here are some more guesses.  More Ram.  Re-boot.  Clear the cache.  Reindex.  Update Stats.  Stand on your head. Buy lottery tickets.

    You are guessing.  You have provided us nothing to go on.  Can we see your code?  How about the execution plan?  You have been on this site for a while. I think you have received a lot of valuable assistance.  Can you understand that you are not going to get many solutions when you cannot provide us with the basics?

     

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

Viewing 5 posts - 16 through 19 (of 19 total)

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