Automated DDL Scripts: How Many Functions to Predict?
I have a script that generates DDL scripts to define materialized views for a normalized database. Some tables have columns such as "owner" that point to a specific database user, which I can then create views for which only the table rows created by the current database user will be displayed. Such views in some cases will be useful both from a security and convenience point of view - for example, showing only one own test result with multiple choices.
The thing is, besides a handful of tables, there are many tables where I could imagine someone asking for this look but can't come up with a specific use case. However, I think that sometimes such general functionality can be useful because I can't always anticipate all the use cases.
My question is, how many of these personalized views should I automatically generate? For several hundred tables, this adds a good chunk of time to build, test, and benchmarking processes, automated though they are. Would you be wrong on the side of additional features that will never be used, or on the accessibility side, only the views that were requested / you know will be useful?
a source to share
This is a good question to ask yourself - generality is (actually) a good thing, but since you observe over-generalization, you can throw you into a combinatorial explosion. Can you foresee that the required DDL bits will be generated "just in time" when the user tries to use it (of course, keeping some "cache" of bits that have already proven to be useful)?
If this is simply not feasible, then, considering the possibility of the exponential growth of "potentially useful views" in the number of tables and columns, I am reluctant to choose the strategy of "do only what is known to be useful / desired" (and strive to ensure that users have very easy to communicate when they need me to add something else ...).
a source to share