Open
Conversation
Signed-off-by: alexey.komyakov <alexey.komyakov@flant.com>
…clang-tidy-20 # Conflicts: # pp/bazel/toolchain/BUILD
vporoshok
requested changes
Mar 25, 2026
Collaborator
vporoshok
left a comment
There was a problem hiding this comment.
Overall solid work — well-structured decorator iterators, good CRTP-based seek infrastructure, thorough test coverage. Two bugs and a few minor items below.
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.
Summary
Implement C++ pushdown optimizations for PromQL functions at the storage layer. When the query engine provides
SelectHints.Func, the storage can now reduce data before it reaches the Go PromQL engine — returning only the samples needed for the specific function instead of the full series.New decorator iterators
MinOverTimeIterator,MaxOverTimeIterator,LastOverTimeIterator,SumOverTimeIterator(viaOverTimeFuncIteratortemplate with pluggable handlers)RateIterator(rate, increase),IRateIterator(irate, idelta)DeltaIterator,ChangesIterator,ResetsIteratorDownsamplingDecodeIterator— interval-based sample reductionRefactored decode iterator infrastructure
DecodeIteratorTraitwithseek(),seek_to(),invalidate(),set()methodsSeekResultenum for composable seek logic (kUpdateSample,kNext,kStop,kUpdateSampleNextAndStop)UniversalDecodeIteratorextended withseek(),seek_to(),invalidate(),set()that dispatch throughstd::visitDecodeIteratorvariant wrapping all iterator types for the Go binding layerFunction dispatch
FunctionNamesHash) for O(1) function name lookupcreate_decode_iterator()dispatches onSelectHints.Functo construct the appropriate iteratorGo bridge changes
SelectHintspassed through cppbridge via ABI-compatibleGenericSelectHints<Go::String, Go::SliceView>downsamplingMsparameter added toQuery()andChunkRecoderpathsDataStorageSerializedDataIteratorcontrol block simplified: directTimestamp()/Value()accessors replacing raw field accessentrypoint::head→entrypoint::series_dataTesting