Conversation
…sue #195) Co-authored-by: makr-code <150588092+makr-code@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement materialized views and incremental maintenance
feat(query): Materialized Views & Incremental Maintenance (v1.8.0, Issue #195)
Mar 15, 2026
Owner
|
@copilot Review und Code Audit. Wurden alle Aufgaben des Issue erfüllt? |
Contributor
Author
All 7 acceptance criteria from the issue are fully implemented and tested:
Other deliverables:
|
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.
Implements pre-computed query result caching with automatic incremental updates for the query domain, targeting v1.8.0.
Description
Core:
MaterializedView+MaterializedViewRegistryinclude/query/materialized_view.h—MaterializedViewclass with four refresh strategies (IMMEDIATE,DEFERRED,PERIODIC,MANUAL), row-levelDeltaOp(INSERT/UPDATE/DELETE), millisecond-granularity staleness tracking, and twocanRewrite()overloads (raw AQL string + parsedquery::QueryAST).MaterializedViewRegistrymanages N views and routes base-table deltas via an invertedtable_index_.src/query/materialized_view.cpp— Thread-safe implementation (per-instance mutex). IMMEDIATE applies deltas in-place by_key; DEFERRED/PERIODIC mark stale; MANUAL is a no-op.canRewrite(aql_string, view)uses a lightweight backward-scan forIN <view_name>— no full re-parse needed. Time-based staleness usesstd::chrono::millisecondsfor sub-second test tolerances.All 7 Acceptance Criteria Fulfilled
Definitionstruct +create()factory with input validationcanRewrite()(string + AST) +MaterializedViewRegistry::tryRewrite()applyDelta()/applyDeltaJson()/applyAggregateDelta(); registry routes viatable_index_refreshStale()isStale()= stale flag OR millisecond time-based expiry;markStale(),ViewStats::is_stalegetRows()/queryRows()— no query re-executionBuild & CI
materialized_view.cppadded toTHEMIS_QUERY_SOURCESincmake/ModularBuild.cmaketest_materialized_view_focusedtarget added totests/CMakeLists.txt.github/workflows/materialized-views-incremental-maintenance-ci.ymltriggers on relevant path changes, Ubuntu 22.04/24.04 matrixDocumentation
src/query/FUTURE_ENHANCEMENTS.md— section marked ✅ ImplementedType of Change
Testing
36 tests in
tests/test_materialized_view.cppcovering all 7 acceptance criteria: view creation,canRewrite(string + AST), IMMEDIATE/DEFERRED/PERIODIC/MANUAL delta behavior, staleness flag + time-based expiry (polling-based, CI-safe), snapshot access latency (<10 ms for 10k rows), and registry delta routing.📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
Checklist
Original prompt
This section details on the original issue you should resolve
<issue_title>Materialized Views & Incremental Maintenance</issue_title>
<issue_description>### Context
This issue implements the roadmap item 'Materialized Views & Incremental Maintenance' for the query domain. It is sourced from the consolidated roadmap under 🟡 Medium Priority — Near-term (v1.5.0 – v1.8.0) and targets milestone v1.8.0.
Primary detail section: Materialized Views & Incremental Maintenance
Goal
Deliver the scoped changes for Materialized Views & Incremental Maintenance in src/query/ and complete the linked detail section in a release-ready state for v1.8.0.
Detailed Scope
Materialized Views & Incremental Maintenance
Priority: Medium
Target Version: v1.8.0
Pre-computed query results with automatic incremental updates.
Features:
API:
Incremental Maintenance:
Performance Impact:
Acceptance Criteria
Relationships
References
Generated from the consolidated source roadmap. Keep the roadmap and issue in sync when scope changes.
</issue_description>
Comments on the Issue (you are @copilot in this section)
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.