You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/index-overview.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Azure Cosmos DB currently supports three types of indexes. You can configure the
69
69
70
70
### Range Index
71
71
72
-
**Range**index is based on an ordered tree-like structure. The range index type is used for:
72
+
**Range**indexes are based on an ordered tree-like structure. The range index type is used for:
73
73
74
74
- Equality queries:
75
75
@@ -169,15 +169,15 @@ Spatial indexes can be used on correctly formatted [GeoJSON](./sql-query-geospat
169
169
SELECT * FROM container c WHERE c.property1 = 'value' ORDER BY c.property1, c.property2
170
170
```
171
171
172
-
- Queries with a filter on two or more properties were at least one property is an equality filter
172
+
- Queries with a filter on two or more properties where at least one property is an equality filter
173
173
174
174
```sql
175
175
SELECT * FROM container c WHERE c.property1 = 'value' AND c.property2 > 'value'
176
176
```
177
177
178
178
As long as one filter predicate uses one of the index type, the query engine evaluates that first before scanning the rest. For example, if you have a SQL query such as`SELECT * FROM c WHERE c.firstName = "Andrew" and CONTAINS(c.lastName, "Liu")`
179
179
180
-
- The above query will first filter for entries where firstName ="Andrew" by using the index. It then pass all of the firstName ="Andrew" entries through a subsequent pipeline to evaluate the CONTAINS filter predicate.
180
+
- The above query will first filter for entries where firstName ="Andrew" by using the index. It then passes all of the firstName ="Andrew" entries through a subsequent pipeline to evaluate the CONTAINS filter predicate.
181
181
182
182
- You can speed up queries and avoid full container scans when using functions that perform a full scan like CONTAINS. You can add more filter predicates that use the index to speed up these queries. The order of filter clauses isn't important. The query engine figures out which predicates are more selective and run the query accordingly.
183
183
@@ -205,7 +205,7 @@ Here's a table that summarizes the different ways indexes are used in Azure Cosm
205
205
| Full index scan | Read distinct set of indexed valuesand load only matching items from the transactional data store | Contains, EndsWith, RegexMatch, LIKE | Increases linearly based on the cardinality of indexed properties | Increases based onnumber of items in query results |
206
206
| Full scan | Load all items from the transactional data store | Upper, Lower | N/A | Increases based onnumber of items in container |
207
207
208
-
When writing queries, you should use filter predicate that uses the index as efficiently as possible. For example, if either `StartsWith`or`Contains` would work for your use case, you should opt for `StartsWith` since it does a precise index scan instead of a full index scan.
208
+
When writing queries, you should use filter predicates that use the index as efficiently as possible. For example, if either `StartsWith`or`Contains` would work for your use case, you should opt for `StartsWith` since it does a precise index scan instead of a full index scan.
209
209
210
210
## Index usage details
211
211
@@ -356,9 +356,9 @@ To execute this query, the query engine must do an index seek on `headquarters/e
356
356
357
357
Queries with aggregate functions must rely exclusively on the index in order to use it.
358
358
359
-
In some cases, the index can return false positives. For example, when evaluating `Contains` on the index, the number of matches in the index may exceed the number of query results. The query engine loads all index matches, evaluate the filter on the loaded items, and return only the correct results.
359
+
In some cases, the index can return false positives. For example, when evaluating `Contains` on the index, the number of matches in the index may exceed the number of query results. The query engine loads all index matches, evaluates the filter on the loaded items, and returns only the correct results.
360
360
361
-
For most queries, loading false positive index matches don't have any noticeable effect on index utilization.
361
+
For most queries, loading false positive index matches doesn't have any noticeable effect on index utilization.
0 commit comments