Indexing on replica

Utkarsh upadhyay 20 Reputation points
2024-03-19T07:31:31.7166667+00:00

Can we create an index on read-only replica of azure sql db? if not, then how can we create index on replica directly. I don't want to create index on primary db.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 8,160 Reputation points
    2024-03-19T22:46:42.71+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    In Azure SQL Database, you cannot directly create an index on a read-only replica. By default, secondary replicas in Azure SQL Database are configured in read-only mode for performance and consistency reasons, and this includes restrictions on modifying database schema objects like indexes.

    But, you can enable read-write access on a secondary replica to allow schema modifications, including index creation. However, this approach comes with considerations such as performance impact and potential data consistency issues.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.