Details
Description
If the index requested is a compound index with both the metadata and the time fields:
{
|
createIndexes: 'abc',
|
indexes: [{ 'mm.tag1': 1, time: 1 }]
|
}
|
The index specification created on the bucket collection will be:
|
{
|
createIndexes: 'system.buckets.abc',
|
indexes: [{'meta.tag1': 1, 'control.min.time': 1, 'control.max.time': 1}]
|
}
|
Since buckets in the underlying bucket collection may contain overlapping time ranges, we include both lower and upper bounds in the index to support the query optimizer's ability to order measurements.
Conversely if the time field has to be indexed in descending order, we would transform a compound index:
{
|
createIndexes: 'abc',
|
indexes: [{ 'mm.tag1': 1, time: -1 }]
|
}
|
as follows:
{
|
createIndexes: 'system.buckets.abc',
|
indexes: [{'meta.tag1': 1, 'control.max.time': -1, 'control.min.time': -1}]
|
}
|
Attachments
Issue Links
- is duplicated by
-
SERVER-54641 Support a compound indexes on multiple metadata fields and/or the time field in a time-series collection
-
- Closed
-