Skip to content

Commit 07201a9

Browse files
authored
Update how-to-create-indexes.md
1 parent 873fddb commit 07201a9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

articles/cosmos-db/mongodb/vcore/how-to-create-indexes.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Indexes should be created only for queryable fields. Wildcard indexing should be
2727
When a new document is inserted for the first time or an existing document is updated or deleted, each of the specified fields in the index is also updated. If the indexing policy contains a large number of fields (or all the fields in the document), more resources are consumed by the server in updating the corresponding indexes. When running at scale, only the queryable fields should be indexed while all remaining fields not used in query predicates should remain excluded from the index.
2828

2929
## Create the necessary indexes before data ingestion
30-
For optimal performance, indexes should be created upfront before data is loaded. All document writes, updates and deletes will have corresponding indexes updated synchronously. If indexes are created after data is ingested, more server resources are consumed to index historical data. Depending on the size of the historical data, this operation is time consuming and impacts steady state read and write performance.
30+
For optimal performance, indexes should be created upfront before data is loaded. All document writes, updates and deletes will synchronously update the corresponding indices. If indexes are created after data is ingested, more server resources are consumed to index historical data. Depending on the size of the historical data, this operation is time consuming and impacts steady state read and write performance.
3131

3232
> [!NOTE]
3333
For scenarios where read patterns change and indexes need to be added, background indexing should be enabled, which can be done through a support ticket.
@@ -50,11 +50,6 @@ Compound indexes should be used in the following scenarios:
5050
- Queries with filters on any field in the JSON structure making it easier to use wildcard indexing instead of indexing each field individually.
5151
- Queries with filters on all but a few fields making it is easier to exclude a few fields instead of indexing most of the fields individually.
5252

53-
Wildcard indexing will soon be available in Azure Cosmos DB for MongoDB vCore. Until then, this sample provides a workaround to circumvent creating individual indexes. The solution takes a sample json file and performs the following actions:
54-
- Iterates through each root level field and creates an index on the field.
55-
- Iterates through each nested field and creates an index in the field after concatenating the path to the nested field.
56-
- Handles Objects, Arrays and base field types accordingly
57-
5853
Consider the following document within the 'cosmicworks' database and 'employee' collection
5954
```json
6055
{

0 commit comments

Comments
 (0)