Thank you Michael Mior, for putting together a initial version of materialized view documentation! I'm not sure about the ultimate structure of the document yet, so just a couple of thoughts based on what we have here:
1. I like the first section talking about materialization usage in adapters, so maybe it would make more sense if we include usage scenarios from other adapters. Think I can do the Phoenix part.
2. Before jumping into the limitations and technical details of a specific materialized view rewriting rule, it would be nicer to have an introduction of the basic materialized view rewriting idea and some general rewriting rules. List a few query examples with what they would become after rule application.
3. We could put some important or interesting rewriting rules in sub-sections and talk about some details and limitations, as well as possible future improvement.
4. I believe right now we have two types of materialized view rewriting rules applied in different stages of query planning, one based on SubstitionVisitor which happens right before volcano planning, the other being RelOptRule which happens during the volcano planning process. So it would be great to talk about their differences and their own preferred scenarios.