[SERVER-30188] Index option to skip keys that are too large Created: 17/Jul/17  Updated: 27/Oct/23  Resolved: 18/Jul/17

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

Type: Question Priority: Minor - P4
Reporter: Karolin Varner Assignee: Backlog - Storage Execution Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-12834 Create flag to allow mongod to ignore... Closed
Related
related to SERVER-3372 Allow indexing fields of arbitrary le... Closed
Assigned Teams:
Storage Execution
Participants:

 Description   

Currently if there is any document with a key too large to be indexed (>1024), an error will be thrown and the index will not be created.

I would like to have an option to skip those values and index all the other keys.

As far as I can see, this can not be achieved with partial indices for multikey indices, since partial indices can only exclude the entire document from being indexed, not a single element from the array being indexed.



 Comments   
Comment by Karolin Varner [ 18/Jul/17 ]

@Eric Awesome! Thank you for that info, I'll watch that ticket then

Comment by Eric Milkie [ 18/Jul/17 ]

Instead of implementing this idea (which would be counted as "index corruption" by our validation checking), we are instead working on lifting the index key length limit, which is only necessarily for the MMAPv1 storage engine; see SERVER-3372

Comment by Karolin Varner [ 18/Jul/17 ]

Hi Stephen,
thank you very much, I didn't know about that parameter and I agree it shouldn't be set to false globally.
Could you introduce this as a per-index parameter, so I don't introduce unexpected behaviour in cases where I don't explicitly need it?

Best,
Karolin

Comment by Stennie Steneker (Inactive) [ 18/Jul/17 ]

Hi Karolin,

There is already a failIndexKeyTooLong server parameter which you can set to false if you want to ignore values that exceed the index key length limit.

Generally this isn't a recommended parameter to disable. If failIndexKeyTooLong is set to false, documents will silently fail to be included in indexes when a value is too long to index.

This can lead to some unexpected behaviors (see SERVER-5290 for a few examples).

Regards,
Stephen

Comment by Karolin Varner [ 17/Jul/17 ]

Thanks, I only noticed when I couldn't change it any more!

Comment by Eric Milkie [ 17/Jul/17 ]

This doesn't appear to be filed in the correct product, as you are talking about MongoDB. I will move it now.

Generated at Thu Feb 08 04:22:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.