DDL Implementation Options #111
Closed
kgodey
announced in
Maintainer discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Note: These notes are moved from our wiki, they're a couple of months old, and may not be congruent with the current conception of Mathesar. However, we still need to discuss how to handle splitting tables up, when to create views, etc. and it's useful to have these as a reference.
Options to discuss:
Map table creation, deletion or modification directly to underlying tables (create, drop, or alter)
Map table operations to underlying materialized views.
WITH
statements as we create these views. It would be a bit gross SQL-wise, but would have the desired functionality.WITH
statements to generate MVA from the original input format, we add aWITH
statement encoding MVA, along with an appropriate query to generate MVB from MVA.Map table operations to underlying (non-materialized) calculated views.
Hybrid approach (Brent's favorite at the moment)
For tables that we intend the user to be able to insert into, it might be best to use materialized views, with the intricate set of triggers in place to keep things consistent. It should be possible to iteratively generate these triggers as the user creates new tables under most (maybe all? not sure...) circumstances. For other tables, where input to the table makes no sense, we might want to just call them "views" even in the UI, and use normal views (or materialize them if desired for performance). An example of this would be a view involving aggregation of data from another table. It doesn't make sense to insert into such an aggregation.
Beta Was this translation helpful? Give feedback.
All reactions