Class RelOptMaterializations


  • public abstract class RelOptMaterializations
    extends java.lang.Object
    Utility methods for using materialized views and lattices for queries.
    • Constructor Detail

      • RelOptMaterializations

        public RelOptMaterializations()
    • Method Detail

      • useMaterializedViews

        public static java.util.List<Pair<RelNode,​java.util.List<RelOptMaterialization>>> useMaterializedViews​(RelNode rel,
                                                                                                                     java.util.List<RelOptMaterialization> materializations)
        Returns a list of RelNode transformed from all possible combination of materialized view uses. Big queries will likely have more than one transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2).
        Parameters:
        rel - the original RelNode
        materializations - the materialized view list
        Returns:
        the list of transformed RelNode together with their corresponding materialized views used in the transformation.
      • useLattices

        public static java.util.List<Pair<RelNode,​RelOptLattice>> useLattices​(RelNode rel,
                                                                                    java.util.List<RelOptLattice> lattices)
        Returns a list of RelNode transformed from all possible lattice uses.
        Parameters:
        rel - the original RelNode
        lattices - the lattice list
        Returns:
        the list of transformed RelNode together with their corresponding lattice used in the transformation.
      • getApplicableMaterializations

        public static java.util.List<RelOptMaterialization> getApplicableMaterializations​(RelNode rel,
                                                                                          java.util.List<RelOptMaterialization> materializations)
        Returns a list of materializations that can potentially be used by the query.
      • usesTable

        private static boolean usesTable​(java.util.List<java.lang.String> qualifiedName,
                                         java.util.Set<RelOptTable> usedTables,
                                         Graphs.FrozenGraph<java.util.List<java.lang.String>,​DefaultEdge> usesGraph)
        Returns whether table uses one or more of the tables in usedTables.