Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-78594

Make timeseries collection support analyzeShardKey and configureQueryAnalyzer commands

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sharding NYC

      A timeseries collection inside MongoDB is writable non-materialized view of an internal bucket collection. The analyzeShardKey and configureQueryAnalyzer commands currently do not work with timeseries collections because:

      • The analyzeShardKey command cannot calculate the cardinality, frequency and monotonicity metrics for a timeseries collection the same way it does for a ordinary collection since the data is stored in bucket documents as shown in the following example.
        [
         	{
         		"_id" : ObjectId("649f39e0f61e0c02d1a008d0"),
         		"control" : {
         			"version" : 1,
         			"min" : {
         				"_id" : ObjectId("649f3a101400fcf278694868"),
         				"ts" : ISODate("2023-06-30T20:24:00Z")
         			},
         			"max" : {
         				"_id" : ObjectId("649f3a101400fcf2786948cb"),
         				"ts" : ISODate("2023-06-30T20:24:48.125Z")
         			}
         		},
         		"data" : {
         			"ts" : {
         				"0" : ISODate("2023-06-30T20:24:48.124Z"),
         				"1" : ISODate("2023-06-30T20:24:48.124Z"),
         				...
         				"99" : ISODate("2023-06-30T20:24:48.125Z")
         			},
         			"_id" : {
         				"0" : ObjectId("649f3a101400fcf278694868"),
         				"1" : ObjectId("649f3a101400fcf278694869"),
         				...
         				"99" : ObjectId("649f3a101400fcf2786948cb")
         			}
         		}
         	}
         ]
        
      • There are various restrictions on the shard key for a timeseries collection that the analyzeShardKey command.
      • The configureQueryAnalyzer command needs to account for the fact that reads and writes for a timeseries collection sometime show up with the view namespace and sometimes with the bucket namespace.

            Assignee:
            ratika.gandhi@mongodb.com Ratika Gandhi
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: