Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
Q3/2026 Server Development
Description
Foundational ticket for MDEV-12163 — Materialized Views. Owns the new SQL surface, on-disk layout, version registry, and the REFRESH MATERIALIZED VIEW lifecycle.
Scope (design + dev + code review together):
- New SQL surface: CREATE MATERIALIZED VIEW, REFRESH MATERIALIZED VIEW, DROP MATERIALIZED VIEW (parser + .frm storage with the prefix#version scheme).
- Storage: materialised data in an Aria non-transactional read-only table. Latest version's .frm stored as table_name.frm (rename on supersession to avoid glob-by-version directory scans — see Caveats in the Epic).
- In-memory version registry (TABLE_SHARE-based) holding latest version number / timestamp.
- REFRESH body: take MDL_SHARED_NO_WRITE, bump version, log prepare_drop in DDL log, create table_name#version, copy data, clean up old unused versions, unlock.
- Concurrency: enforce no-concurrent-REFRESH.
- DROP: MDL_EXCLUSIVE, wait for existing transactions to release, drop all versions.
- New server variable for max stored versions / total view size (per Epic 'General approach').
- Code-review iteration.
Depends on: nothing (foundational).
Blocks: the DML and Recovery sub-tickets.
Estimate baseline: 25d core dev + 6d design + 3d code review = 34d distributed across REFRESH / DML / Recovery. This ticket: ~17d.