[SERVER-59087] add primary key index on _id field in time series collection Created: 04/Aug/21  Updated: 27/Oct/23  Resolved: 23/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.1
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: 显卓 刘 Assignee: Michael Gargiulo
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Execution Team 2021-08-09, Execution Team 2021-08-23, Execution Team 2021-09-06
Participants:

 Description   

add primary key index on _id field in time series collection



 Comments   
Comment by Michael Gargiulo [ 04/Aug/21 ]

Hi xianzhuo.sky@gmail.com Time series collections behave different from regular collections when it comes to the primary key index. The primary key index of a Time Series collection is an automatically created clustered index on a server generated unique _id value for a group of documents with a unique metaField for a time span. This index and value can be seen in the corresponding system.buckets.foo collection for your Time Series collection, but is more for internal usage, e.g. the TTL index if enabled.

The _id of the document cannot currently be indexed and cannot be the primary key index for a Time Series collection like a regular collection. That being said, we are currently working on allowing secondary index creation on the _id field for Time Series collections so that you may still create an index on the _id of the document if needed 

Generated at Thu Feb 08 05:46:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.