Stored procedure run 10 sec in primary server but keeps running(not executed) in secondary server in always on configured servers. I've verified all configurations, both are identical but execution plans are different. How to make both plans are identical in always on sql server 2012 version.
Sql-server – Stored procedure query plan different in Always on server
sql server
Related Question
- SQL Server – Inconsistent Execution Plan for Stored Procedure
- Sql-server – Replication between two different SQL Server versions
- SQL Server – If Logic in Stored Procedure and Plan Cache Optimization
- SQL Server – Slow First Stored Procedure Execution After Restoring Log Shipping to Secondary Server
- SQL Server: Execute Stored Procedure Inside Another from Linked Server
- Sql-server – Same query but different plan on different server
Best Answer
They are not identical:
on primary you have probably different cached data.
A longer time can be consequence of more time spent on disk.
Also statistics are different: you have in both database the statistics created on primary. But on secondary you also have statistics stored in tempdb.
You can go deeper comparing the execution plans.