[SERVER-55240] Support 2d index on time-series collection metadata fields Created: 16/Mar/21  Updated: 05/Aug/21  Resolved: 05/Aug/21

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

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dan Larkin-York
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-54642 Support other index types on the meta... Closed
is related to SERVER-56265 Test that $geoNear/$text against time... Closed
Sprint: Execution Team 2021-07-12, Execution Team 2021-08-09
Participants:

 Description   

Because metadata does not vary within a bucket, geo indexes on metadata can use an ordinary geo index on the time-series buckets collection.

For example,

{
	createIndexes: “abc”,
	indexes: [ { key: { “metaFieldName.a” : "2d" } } ]
}

will become

{
	createIndexes: “system.buckets.abc”,
	indexes: [ { key: { “meta.a” : "2d" } } ]
}

 

 

 

JS test code

assert.eq(1,
          timeseriescoll.find({[metaFieldName]: {$near: [0, 0]}}).toArray().length,
          "Failed to use index: " + tojson(twoDTimeseriesIndexSpec));

JS test logs

[js_test:timeseries_special_indexes] uncaught exception: Error: error: {
[js_test:timeseries_special_indexes] 	"ok" : 0,
[js_test:timeseries_special_indexes] 	"errmsg" : "$geoNear, $near, and $nearSphere are not allowed in this context",
[js_test:timeseries_special_indexes] 	"code" : 2,
[js_test:timeseries_special_indexes] 	"codeName" : "BadValue"
[js_test:timeseries_special_indexes] } :
[js_test:timeseries_special_indexes] _getErrorWithCode@src/mongo/shell/utils.js:25:13
[js_test:timeseries_special_indexes] DBCommandCursor@src/mongo/shell/query.js:711:15
[js_test:timeseries_special_indexes] DBQuery.prototype._exec@src/mongo/shell/query.js:113:28
[js_test:timeseries_special_indexes] DBQuery.prototype.hasNext@src/mongo/shell/query.js:288:5
[js_test:timeseries_special_indexes] DBQuery.prototype.toArray@src/mongo/shell/query.js:342:12
[js_test:timeseries_special_indexes] @jstests/core/timeseries/timeseries_special_indexes.js:170:11
[js_test:timeseries_special_indexes] @jstests/core/timeseries/timeseries_special_indexes.js:18:2
[js_test:timeseries_special_indexes] failed to load: jstests/core/timeseries/timeseries_special_indexes.js

Note: the same query on the corresponding buckets collection works fine, so the index is created via the time-series collection, we just can't use it.



 Comments   
Comment by Githook User [ 05/Aug/21 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-55240 Support 2d index on time-series collection metadata fields
Branch: master
https://github.com/mongodb/mongo/commit/f5a1fd7609a80edf04a41f0bcb3cf63ad673b0ba

Comment by Kyle Suarez [ 29/Apr/21 ]

Per louis.williams, we are still doing this work and it will be part of a project to support secondary indexes more generally for time-series metrics.

Comment by Kyle Suarez [ 29/Apr/21 ]

dianna.hohensee, is it safe to close this one out? It's still marked as open, so I'm unsure if there were further developments.

Comment by Dianna Hohensee (Inactive) [ 22/Mar/21 ]

Closing this out as Won't Do. We do not currently plan to support geo.

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