Commit e56a49c
committed
Replacement materialized views
Implements the skeleton to support replacing materialized views.
Specifically, the change introduces the following SQL syntax:
```
CREATE REPLACEMENT <replacement_name>
FOR MATERIALIZED VIEW <view_name
AS ...
```
This creates a new dataflow targeting the same shard. The dataflow
selects an as-of of its inputs. The dataflow is read-only.
```
ALTER MATERIALIZED VIEW <view_name>
APPLY REPLACEMENT <replacement_name>
```
Replaces the old materialized view with `<replacement_name>`. Enables
writes for the replacement.
The change adds convenience SQL syntax (`SHOW REPLACEMENTS`, `SHOW
CREATE REPLACEMENT`), and relations to query the state of replacements.
The syntax to create replacements is guarded by a feature flag that is
off by default: `enable_replacement_materialized_views`.
Signed-off-by: Moritz Hoffmann <[email protected]>1 parent 07a134e commit e56a49c
File tree
77 files changed
+3992
-349
lines changed- doc/user/content/sql/system-catalog
- misc/python/materialize/mzcompose
- src
- adapter/src
- catalog
- coord
- sequencer
- inner
- optimize
- audit-log/src
- catalog-debug/src
- catalog-protos
- protos
- src
- catalog/src
- durable
- upgrade
- snapshots
- memory
- environmentd
- src/http
- tests/testdata/http
- pgrepr-consts/src
- pgwire/src
- repr/src
- sql-lexer/src
- sql-parser
- src
- ast/defs
- parser
- tests/testdata
- sql/src
- plan
- statement
- session/vars
- storage-client/src
- test
- race-condition
- sqllogictest
- autogenerated
- testdrive
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
77 files changed
+3992
-349
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| 1332 | + | |
1332 | 1333 | | |
1333 | 1334 | | |
1334 | 1335 | | |
| |||
1340 | 1341 | | |
1341 | 1342 | | |
1342 | 1343 | | |
| 1344 | + | |
1343 | 1345 | | |
1344 | 1346 | | |
1345 | 1347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| |||
1553 | 1554 | | |
1554 | 1555 | | |
1555 | 1556 | | |
| 1557 | + | |
1556 | 1558 | | |
1557 | 1559 | | |
1558 | 1560 | | |
| |||
1584 | 1586 | | |
1585 | 1587 | | |
1586 | 1588 | | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1587 | 1592 | | |
1588 | 1593 | | |
1589 | 1594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1925 | 1925 | | |
1926 | 1926 | | |
1927 | 1927 | | |
1928 | | - | |
| 1928 | + | |
| 1929 | + | |
1929 | 1930 | | |
1930 | 1931 | | |
1931 | 1932 | | |
| |||
2046 | 2047 | | |
2047 | 2048 | | |
2048 | 2049 | | |
2049 | | - | |
| 2050 | + | |
| 2051 | + | |
2050 | 2052 | | |
2051 | 2053 | | |
2052 | 2054 | | |
| |||
2116 | 2118 | | |
2117 | 2119 | | |
2118 | 2120 | | |
2119 | | - | |
| 2121 | + | |
| 2122 | + | |
2120 | 2123 | | |
2121 | 2124 | | |
2122 | 2125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
817 | 818 | | |
818 | 819 | | |
819 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
820 | 825 | | |
821 | 826 | | |
822 | 827 | | |
| |||
1462 | 1467 | | |
1463 | 1468 | | |
1464 | 1469 | | |
1465 | | - | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1466 | 1487 | | |
1467 | 1488 | | |
1468 | 1489 | | |
| |||
1519 | 1540 | | |
1520 | 1541 | | |
1521 | 1542 | | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1522 | 1602 | | |
1523 | 1603 | | |
1524 | 1604 | | |
| |||
2266 | 2346 | | |
2267 | 2347 | | |
2268 | 2348 | | |
2269 | | - | |
| 2349 | + | |
| 2350 | + | |
2270 | 2351 | | |
2271 | 2352 | | |
2272 | 2353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
| 890 | + | |
| 891 | + | |
891 | 892 | | |
892 | 893 | | |
893 | 894 | | |
| |||
0 commit comments