Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.1-incubating
    • Component/s: None
    • Labels:
      None

      Description

      Add a "lattice" data structure, to organize, gather statistics on, and recommend materialized queries.

      DDL. Here is a possible SQL DDL syntax:

      CREATE LATTICE SalesStar AS
      SELECT *
      FROM SalesFact AS s
      JOIN TimeDim AS t USING (timeId)
      JOIN CustomerDim AS c USING (customerId)

      Structure. A materialized query would optionally belong to a lattice.

      Constraints. Creating a lattice implies that the first table is the fact table of a star schema, and all joins are many-to-one. That is, foreign keys, primary keys and NOT NULL constraints are implied.

      Statistics. When queries arrive that could use a lattice, a counter is incremented.

      Recommendation. An agent could recommend materialized queries to create based on static analysis of the star schema (e.g. table and column cardinalities), and perhaps statistics of past use.

      View matching. The optimizer uses a lattice to identify materialized queries that could satisfy a query. (Without a lattice, the such space would be much larger, because the optimizer would have to consider many join permutations.)

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -
          Show
          julianhyde Julian Hyde added a comment - Working on this in https://github.com/julianhyde/optiq/commits/optiq-344 .
          Hide
          julianhyde Julian Hyde added a comment -

          Fixed in http://git-wip-us.apache.org/repos/asf/incubator-optiq/commit/acee9632.

          You can now define lattices in your JSON model, and the planner will map queries onto the lattice's virtual "star table". Future tasks are to gather stats in the lattice, define materialized views in the lattice (manually), define materialized views in the lattice (automatically), and rewrite the query to use those materialized views. Next up will be a simple task that defines, populates and uses materialized views on demand.

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-optiq/commit/acee9632 . You can now define lattices in your JSON model, and the planner will map queries onto the lattice's virtual "star table". Future tasks are to gather stats in the lattice, define materialized views in the lattice (manually), define materialized views in the lattice (automatically), and rewrite the query to use those materialized views. Next up will be a simple task that defines, populates and uses materialized views on demand.

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development