Sparse doc values index for LogsDB @timestamp field#121018
Closed
salvatore-campagna wants to merge 13 commits intoelastic:mainfrom
Closed
Sparse doc values index for LogsDB @timestamp field#121018salvatore-campagna wants to merge 13 commits intoelastic:mainfrom
@timestamp field#121018salvatore-campagna wants to merge 13 commits intoelastic:mainfrom
Conversation
@timestamp
@timestamp@timestamp field
| public static final IndexVersion INFERENCE_METADATA_FIELDS = def(9_005_00_0, Version.LUCENE_10_0_0); | ||
| public static final IndexVersion LOGSB_OPTIONAL_SORTING_ON_HOST_NAME = def(9_006_00_0, Version.LUCENE_10_0_0); | ||
| public static final IndexVersion SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP = def(9_007_00_0, Version.LUCENE_10_0_0); | ||
| public static final IndexVersion TIMESTAMP_DOC_VALUES_SPARSE_INDEX = def(9_008_00_0, Version.LUCENE_10_0_0); |
Contributor
Author
There was a problem hiding this comment.
After merging #120741 I will need to increase this to 9_010_00_0 or whatever depending on other PRs merged in the meanwhile.
| public abstract class FieldMapper extends Mapper { | ||
| private static final Logger logger = LogManager.getLogger(FieldMapper.class); | ||
|
|
||
| public static final FeatureFlag DOC_VALUES_SPARSE_INDEX = new FeatureFlag("doc_values_sparse_index"); |
| } | ||
|
|
||
| private boolean hasDocValuesSparseIndex(final String fullFieldName) { | ||
| return index.isConfigured() == false |
| when(mockedParserContext.getIndexSettings()).thenReturn( | ||
| new IndexSettings( | ||
| IndexMetadata.builder("_na_") | ||
| .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current())) |
Contributor
Author
There was a problem hiding this comment.
Adding the index version here is required because we need to validate the existence of the sparse index or the inverted index in DataStreamTimestampFIeldMapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for a sparse doc values index for the
@timestampfield in DateFieldMapper when specific conditions are met:@timestampand mapped as a date field.index: false).When all the conditions above hold true, we:
@timestampfield, dropping the inverted index in favor of the sparse doc values index.Some queries might experience slower performance as a result of using a doc values sparse index instead of an inverted index.
Disabling the inverted index on the
@timestampfield while enabling the sparse doc values index is expected to: