[SERVER-3260] Prefix Indexes Created: 14/Jun/11  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Benjamin Darfler Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 17
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-14974 Create index option to limit an index... Closed
Related
related to SERVER-14784 Add expression indexes Backlog
related to SERVER-15090 Improve Text Indexes to support parti... Backlog
Assigned Teams:
Query Optimization
Participants:
Case:

 Description   

It would be great if we could specify indexes that only index on the prefix of a field. i.e. for BinData on the first n bytes, for strings on the first n characters, etc. This might not work on all data types but it is a great tool for trimming index sizes when applicable.



 Comments   
Comment by Grigorii Eremeev [ 11/May/17 ]

Hey guys, when will you implement this feature?
This ticket was created 3 years ago!
How can I do prefix search now? Use regex?

Comment by Chad Kreimendahl [ 20/Aug/14 ]

This would allow for several benefits:

  • more configurable and useful indexes
  • less memory and/or disk space requirements for indexes
  • higher performance indexing
  • higher performance sorting
  • potentially reduce indexing time on document save
Comment by Chad Kreimendahl [ 20/Aug/14 ]

See our related one. Since 2.6 this has become far more important. I think under nearly all circumstances we would limit every text field we index to something fairly small.

Comment by Mark Callaghan [ 13/Mar/14 ]

This will help with long index keys. Pre-2.6 behavior is to let insert/update succeed and skip index maintenance when the index key is too long. This is bad for index scans that will miss the unindexed doc. 2.6 changed the server to raise an error and make the insert/update fail. This makes the index correct but will be a problem for some existing apps.

Prefix keys are the solution.

Comment by charity majors [ 10/Mar/14 ]

Any plans to implement this soon? It would really help ease the transition to a world where keys too large to index don't get inserted.

Generated at Thu Feb 08 03:02:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.