[SERVER-25023] no way to index the same fields with two different partial index filters Created: 13/Jul/16 Updated: 22/Jun/22 Resolved: 26/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Bernard Gorman |
| Resolution: | Done | Votes: | 13 |
| Labels: | query-44-grooming, storch | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Query 2020-03-09, Query 2020-03-23, Query 2020-04-06, Query 2020-04-20, Query 2020-05-04 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
If I have a large data set, I might want to create several indexes on it, each index covering only a subset of the full set of documents. Currently that's not allowed because we don't allow same pattern with different options, and filter is part of the options. |
| Comments |
| Comment by Githook User [ 25/Apr/20 ] | |||
|
Author: {'name': 'Bernard Gorman', 'email': 'bernard.gorman@gmail.com', 'username': 'gormanb'}Message: | |||
| Comment by Asya Kamsky [ 12/Sep/19 ] | |||
|
There is an additional use case where you may want a different TTL expiration value depending on the type of document or some other partial filter. | |||
| Comment by Michael de Hoog [ 20/Nov/18 ] | |||
|
The workaround we use is to add a non-existant key to the subsequent indexes to make them unique from the first index.
| |||
| Comment by João Ferreira [ 07/Nov/18 ] | |||
|
Additional use case: live index in production that can be made sparse. The ideal solution would be to add the same index, this time sparse, side-by-side; wait until complete; delete initial index. This is not possible due to this bug. | |||
| Comment by Coen Smid [ 03/Oct/18 ] | |||
|
Still waiting for this ticket. Adding 'or' or 'not' features to the partial index would work for my use case as well. | |||
| Comment by Ramon Fernandez Marina [ 04/May/18 ] | |||
|
| |||
| Comment by Asya Kamsky [ 27/Jan/17 ] | |||
|
This is important for views where you want to have a single large collection appear as several smaller collections so every query under the hood will start with something like tenant_id='X' and each view is for a specific tenant_id only. | |||
| Comment by Asya Kamsky [ 08/Sep/16 ] | |||
|
That does not address this use case at all. The goal is to split a large index into several smaller indexes. | |||
| Comment by Max Hirschhorn [ 02/Sep/16 ] | |||
|
If we could express a $or in the partialFilterExpression (SERVER-17853), then there wouldn't be a need to create two partial indexes as the OR stage would be able to make use of the same index for each clause. |