Skip to content

Commit 919dfe9

Browse files
committed
addressing additional feedback comments from gahl
1 parent 54fe788 commit 919dfe9

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

articles/cosmos-db/mongodb/vcore/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
- name: Cross-region replication
4444
href: cross-region-replication.md
4545
- name: Indexing
46-
href: indexing-basics.md
46+
href: indexing.md
4747
- name: Reliability
4848
href: /azure/reliability/reliability-cosmos-mongodb?toc=/azure/cosmos-db/mongodb/vcore/toc.json
4949
- name: Compute and storage

articles/cosmos-db/mongodb/vcore/background-indexing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ Background indexing is a technique that enables a database system to perform ind
1919

2020
Background indexing can be enabled using the property `enableIndexBuildBackground` set to `true`. All indexes would be created in background except the unique indexes, post enabling the property.
2121

22-
If working with smaller SKUs or workloads with higher I/O needs, it becomes necessary to predefine indexes on empty collections and avoid relying on background indexing.
22+
If working with smaller tiers or workloads with higher I/O needs, it's recommended to predefine indexes on empty collections and avoid relying on background indexing.
2323

2424
> [!NOTE]
25-
> Enabling feature requires raising a support request.
25+
> Background indexing is a Preview feature. Enabling this feature requires raising a support request.
2626
2727
> [!IMPORTANT]
28-
> Ensure creating unique indexes on an empty collection as those are created in foreground.
28+
> It is advised to create `unique` indexes on an empty collection as those are created in foreground, which results in blocking of reads and writes.
2929
>
30-
> It is vital to create indexes based on query predicates beforehand, while the collection is still empty. It prevents resource contention if pushed on read-write heavy large collection.
30+
> It is advised to create indexes based on query predicates beforehand, while the collection is still empty. It prevents resource contention if pushed on read-write heavy large collection.
3131
3232
## Monitor index build
3333

34-
We can learn about the progress of index build with command `currentOp`.
34+
We can learn about the progress of index build using command `currentOp()`.
3535

3636
```javascript
3737
db.currentOp("db_name":"<db_name>", "collection_name":"<collection_name>")
@@ -91,10 +91,10 @@ inprog: [
9191

9292
## Limitations
9393

94-
- Unique indexes can't be created in the background, it's best to create them on an empty collection and then load the data.
95-
- Background indexing is performed sequentially within a single collection. However, background indexing can run concurrently across multiple collections.
94+
- Unique indexes can't be created in the background. It's best to create them on an empty collection and then load the data.
95+
- Background indexing is performed sequentially within a single collection. However, the number of simultaneous index builds on different collections is configurable (default: 2).
9696

9797
## Next Steps
9898

9999
> [!div class="nextstepaction"]
100-
> [Best Practices](how-to-create-indexes.md)
100+
> [Best practices](how-to-create-indexes.md)

articles/cosmos-db/mongodb/vcore/indexing-basics.md renamed to articles/cosmos-db/mongodb/vcore/indexing.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ ms.date: 06/27/2024
1515

1616
[!INCLUDE[MongoDB vCore](~/reusable-content/ce-skilling/azure/includes/cosmos-db/includes/appliesto-mongodb-vcore.md)]
1717

18-
Indexes are structures that improve data retrieval speed by providing quick access to rows in a table. They work by creating an ordered set of pointers to data, often based on key columns. MongoDB vcore utilizes indexes in multiple contexts, including query push down, unique constraints and sharding.
18+
Indexes are structures that improve data retrieval speed by providing quick access to fields in a collection. They work by creating an ordered set of pointers to data, often based on key fields. Azure Cosmos DB for MongoDB vcore utilizes indexes in multiple contexts, including query push down, unique constraints and sharding.
1919

2020
> [!IMPORTANT]
21-
> The "_id" field is the **only** field indexed by default. It is recommended to add additional indexes based on query filters & predicates to optimize performance.
21+
> The "_id" field is the **only** field indexed by default & maximum size of the field can be `2 KB`. It is recommended to add additional indexes based on query filters & predicates to optimize performance.
2222
2323
## Index types
2424

@@ -43,9 +43,9 @@ This example application stores articles as documents with the following structu
4343

4444
## Single field indexes
4545

46-
Single field indexes store information from a single field in a collection. The sort order of the single field index doesn't matter. _id field remains indexed by default.
46+
Single field indexes store information from a single field in a collection. The sort order of the single field index doesn't matter. `_id` field remains indexed by default.
4747

48-
MongoDB vcore supports creating index at following
48+
Azure Cosmos DB for MongoDB vcore supports creating index at following
4949

5050
- Top-level document fields.
5151
- Embedded document.
@@ -65,7 +65,7 @@ db.products.createIndex({"author.firstName": -1})
6565
One query can use multiple single field indexes where available.
6666

6767
> [!NOTE]
68-
> Azure Cosmos DB for MongoDB vcore allows creating maximum of 64 indexes on a collection.
68+
> Azure Cosmos DB for MongoDB vcore allows creating maximum of 64 indexes on a collection. Depending on the tier, we can plan extension up to 300 indexes upon request.
6969
7070
## Compound indexes
7171

@@ -79,7 +79,7 @@ use cosmicworks
7979
db.products.createIndex({"author":1, "launchDate":-1})
8080
```
8181

82-
`Order` of columns affect the selectivity or utilization of index. The `find` query wouldn't utilize the index created.
82+
`Order` of fields affect the selectivity or utilization of index. The `find` query wouldn't utilize the index created.
8383

8484
```javascript
8585
use cosmicworks
@@ -113,10 +113,9 @@ This same compound index doesn't work in this case since there's an array in the
113113
}
114114
```
115115

116-
Compound index provides support for
116+
**Limitations**
117117

118-
- Maximum of 32 columns within a compound index.
119-
- Indexing nested properties.
118+
- Maximum of 32 fields\paths within a compound index.
120119

121120
## Partial indexes
122121

@@ -295,10 +294,11 @@ db.collection.createIndex({a: "2d", b: 1})
295294
}
296295
}
297296
})
297+
298298
// MongoServerError: $geoWithin currently doesn't support polygons with holes
299299
```
300-
301-
1. If there's any unfiltered document that has polygon with holes.
300+
301+
1. If there's any unfiltered document that has polygon with holes.
302302

303303
```javascript
304304
[mongos] test> coll.find()
@@ -314,10 +314,11 @@ db.collection.createIndex({a: "2d", b: 1})
314314
}
315315
}
316316
]
317+
317318
// MongoServerError: $geoWithin currently doesn't support polygons with holes
318319
```
319320

320-
- `key` field is mandatory while using `geoNear`.
321+
1. `key` field is mandatory while using `geoNear`.
321322

322323
```javascript
323324
[mongos] test> coll.aggregate([{ $geoNear: { near: { "type": "Point", coordinates: [0, 0] } } }])
@@ -327,6 +328,7 @@ db.collection.createIndex({a: "2d", b: 1})
327328

328329
## Next steps
329330

330-
- Check more on how to work with [text indexing](how-to-create-text-index.md).
331-
- Check more on how to work with [wildcard indexing](how-to-create-wildcard-indexes.md).
332-
- Review [Best Practices](how-to-create-indexes.md) for best possible outcome on Azure CosmosDB for MongoDB vcore.
331+
- Learn about indexing [Best practices](how-to-create-indexes.md) for most efficient outcomes.
332+
- Learn about [background indexing](background-indexing.md)
333+
- Learn here to work with [Text indexing](how-to-create-text-index.md).
334+
- Learn here about [Wildcard indexing](how-to-create-wildcard-indexes.md).

0 commit comments

Comments
 (0)