algebra-sql-0.1.0.1: Relational Algebra and SQL Code Generation

Safe HaskellNone
LanguageHaskell98

Database.Algebra.SQL.Materialization.Combined

Description

Materializes tiles which are reachable through multiple root tiles as temporary tables and everything else by using common tables expressions. It is possible to choose the binding strategy for common table expressions:

  • Bind in lowest possible CTE, results in toughest possible scoping, tiles are only bound where they are actually used.
    • Bind in highest possible CTE, tiles are bound at the highest possible CTE, results in very few common table expressions.

Synopsis

Documentation

data BindingStrategy Source

Describes the binding behaviour within a dependency tree.

Constructors

Lowest 
Highest 

materialize :: MatFun Source

Same as materializeByBehaviour with Lowest as behaviour.

materializeByBindingStrategy :: BindingStrategy -> MatFun Source

Merges all tiles reachable by a single root tile into nested common table expressions (depending on their scope) and all tiles reachable by multiple root tiles into a temporary table. The binding strategy determines whether it is merged in the highest possible CTE or in the lowest.