Indexing on replica

Utkarsh upadhyay 20 Reputation points

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 1,515 Reputation points

    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