
To visualize the data, define the x-axis and y-axis with two dropdowns. The data Analyzer tab will help you with simple analysis requirements. This can be a challenge since returned data is in JSON format. Sometimes, you may need to analyze the data returned by a query. The following example shows Indexing Metrics in action, as you can see the WHERE clause has many filters and Azure Cosmos DB suggests me a Composite Index. Test these suggestions before you try to put them into any production indexing policy. It does not analyze your data when it makes these suggestions. It analyzes your query and suggests indexes. This will make the Indexing Metrics tab available beside the Results tab.Īzure Cosmos DB Indexing Engine communicates via the Indexing Metrics feature. You can easily run this feature by checking the Display Indexing Metrics in Options.
#AZURE DATA STUDIO EXECUTION PLAN HOW TO#
This is not an easy feature to demonstrate, especially if you don’t know how to code. You can see which indexes are getting used by queries and find out if Azure Cosmos DB suggests you create new indexes for your queries.

The Indexing Metrics is another great feature of Azure Cosmos DB. In the following example, this point read operation costs only 1 R/U. Since you use fewer resources for Point Read operation, you will get charged fewer Request Units (RUs). Azure Cosmos DB does not need to create a query execution plan for this request. By giving these two values you are telling Azure Cosmos DB exactly where to find the data you are looking for. To make a Point Read call, you must pass the partition key value and the document id of the document. You can reach this functionality by clicking on the Point Read tab. You can easily look at the current indexing policy for the selected container by clicking on the Indexing Policy tab.Īzure Cosmos DB SQL Studio lets you make Point Read calls. You can see each physical partition’s execution plan by clicking on the link for the Number of Requests property. Your query might need to retrieve data from multiple physical partitions if you do not include the partition key of the selected container in the query. Usually, you fix this problem by changing your indexing policies. The gap between these two numbers tells you that there might be some opportunities to make your query faster/cheaper. Retrieved Documents value and Index Hit Documents value should be equal or very close to each other. There are two numbers here you should watch closely. You can see execution Metrics by clicking on the tab to the right side of the results. You will see the Request Charge and the Number of items in the middle section. To run a query, type your query and click on the Execute button. If you do not include the partition key of your container in your queries, Azure Cosmos DB will run your query in 5 physical partitions. In the following example, the selected container has 5 physical partitions. You can easily find how many physical partitions a container has by clicking the Partition List button. You should see all your databases and containers on the top. The application does not have write functionality so you can use the read-only keys if you like. I suggest you use the second option, copy and paste any of your connection strings from the Azure Portal to the textbox and click on the Connect button to continue.

This option works well if you are the owner of the Azure subscription, if you do not own the subscription, you might not have the rights to run some of the functions it requires. The first option “Connect by VsCode Azure Account” uses the VSCode Azure extension and a token to get access to your account. This screen asks you how you would like to connect to your Azure Cosmos DB account. Press Ctrl + Shift + P and find Azure Cosmos DB SQL Studio from the list to start the extension.Īfter you select the Azure Cosmos DB SQL Studio, you will see the following screen. If you are new to VSCode, you need to know how to start/use an extension.

#AZURE DATA STUDIO EXECUTION PLAN DOWNLOAD#
Azure Cosmos DB SQL Studio is a free VSCode extension you can download directly from the VSCode Extensions tab or the VSCode Marketplace website. It is a user-friendly, free tool that is not browser-based and doesn’t require you to know C# or Java to interact with Azure Cosmos DB. I developed the extension for all levels of users within the Azure Cosmos DB community. Most of these features especially the new ones are at the SDK level, and you need to know. Īzure Cosmos DB Core (SQL) API has many features that can help you with your cloud projects in Microsoft Azure. This post was authored by Microsoft MVP and Azure Cosmos DB c ommunity champion Hasan Savran.
