Algorithm Search⌘K

Relational model and theory

Problems

  • Attribute closure problem

    Given functional dependencies F and an attribute set X, compute X+, the set of all attributes that X determines under F. It takes linear time.

    core
  • Lossless-join decomposition problem

    Decide whether splitting a schema into parts loses information: every relation that satisfies the dependencies must equal the natural join of its projections on the parts.

    1 languagescore
  • Minimal cover problem

    Find an FD set equivalent to F with single-attribute right sides, no extraneous left-side attribute and no redundant FD. Polynomial, but minimal covers are not unique.

    1 languagescore
  • Datalog evaluation problem

    Given a Datalog program and a database, compute the least fixed point of the rules, or the facts of it that a query asks for. P-complete in the data and EXPTIME-complete in the program.

    advanced
  • Dependency implication problem

    Decide whether a set of dependencies implies another. For FDs this takes linear time, but finding a key of size at most k and testing a prime attribute are NP-complete.

    1 languagesadvanced
  • Query containment problem

    Decide whether one query returns a subset of the answers of another query on every database. NP-complete for conjunctive queries and undecidable for the full relational calculus.

    advanced
  • Regular path query evaluation

    Find the pairs of nodes of an edge-labeled graph that are joined by a path whose labels spell a word of a given regular language.

    advanced

Algorithms

  • 3NF synthesis

    Builds a 3NF decomposition that is lossless and dependency preserving: one schema per left side of a minimal cover, plus a key schema if needed, minus subsumed schemas.

    O(n (n + m)²) worst1 languagescore
  • Attribute closure algorithm

    Computes the closure X+ of an attribute set under functional dependencies in linear time, with one counter per FD for its left-side attributes not yet reached.

    Θ(n + m) worst · average · best1 languagescore
  • BCNF decomposition

    Split a relation schema on a functional dependency that violates BCNF, again and again, until every part is in BCNF. The result is a lossless join, but it can lose dependencies.

    O(4^n m) worst1 languagescore
  • GYO reduction

    Test whether a hypergraph is alpha-acyclic by repeatedly deleting vertices in one edge only and edges contained in another edge.

    O(m^3 v^2) worst1 languagescore
  • Tableau test for lossless join

    Decide if a decomposition into any number of parts has a lossless join under FDs. Chase a tableau with one row per part; the join is lossless exactly when some row becomes all distinguished.

    O(k^2 a (1 + m log k)) worst1 languagescore
  • Chase algorithm

    Repair a tableau of symbols with functional and join dependencies until none is violated. The result decides implication of these dependencies and tests a lossless join.

    O(s^2 n (n + m)) worst1 languagesadvanced
  • Conjunctive query minimization

    Find the smallest equivalent conjunctive query by deleting atoms while the query still maps homomorphically into the smaller one.

    O(a k^(k+1)) worst1 languagesadvanced
  • Semi-naive evaluation

    Bottom-up evaluation of a Datalog program that, in each round, uses only rule instances with at least one fact that is new from the last round. Same result as naive evaluation, less work.

    O(s r k^2 n^v) worst1 languagesadvanced

Techniques

  • Magic sets transformation

    Rewrites a Datalog program for a query with constants, with magic predicates that pass the bindings sideways, so that bottom-up evaluation derives only facts relevant to the query.

    1 languagesresearch

Concepts

  • Database normalization

    The theory of splitting relation schemas into smaller ones to remove redundancy and update anomalies, with normal forms 1NF, 2NF, 3NF, BCNF and 4NF as goals.

    intro
  • Three-valued logic of SQL nulls

    SQL gives a comparison with NULL the value UNKNOWN, combines truth values by Kleene's three-valued logic and keeps a row only when its condition is TRUE, so answers need not be certain.

    core

Definitions

  • Boyce-Codd normal form (BCNF)

    A schema is in BCNF when the left side of every nontrivial functional dependency that holds is a superkey. Testing a schema against its own FDs is polynomial; testing a projection is coNP-complete.

    1 languagesintro
  • Candidate key

    A set of attributes that functionally determines every attribute of a relation and has no proper subset that does.

    intro
  • First normal form (1NF)

    A relation is in first normal form if each attribute value is atomic: no value is itself a set, a list or a relation. Codd's 1970 normalization removes nested relations.

    intro
  • Functional dependency

    A constraint X → Y on a relation: any two tuples that agree on the attributes X must also agree on the attributes Y. Keys are the special case Y = all attributes.

    1 languagesintro
  • Relational algebra

    The query language of six operators on relations: selection, projection, renaming, union, difference and product. Join, intersection and division are derived from them.

    1 languagesintro
  • Second normal form (2NF)

    A relation in first normal form in which no non-prime attribute depends on a proper subset of a candidate key.

    intro
  • Third normal form (3NF)

    A schema is in 3NF if, for each nontrivial FD X → A that holds, X is a superkey or A is in some key. Each schema has a lossless, dependency-preserving 3NF split.

    1 languagesintro
  • Acyclic hypergraph

    A hypergraph whose edges can be arranged in a tree so that the edges that contain any vertex form a connected subtree.

    core
  • Conjunctive query

    A query built from relational atoms with conjunction and existential quantification; it is the select-project-join part of SQL.

    core
  • Dependency-preserving decomposition

    A decomposition preserves the dependencies F when the dependencies that hold inside the parts imply all of F. A polynomial test computes closures without building the projections.

    1 languagescore
  • Fourth normal form (4NF)

    A schema in which every nontrivial multivalued dependency has a superkey on its left side, which removes redundancy from independent facts.

    core
  • Inclusion dependency

    A constraint that the projection of one relation on some attributes is a subset of the projection of another, as a foreign key states.

    core
  • Multivalued dependency

    X ->> Y holds when, for each value of X, the Y values and the values of the other attributes combine freely as a cross product.

    core
  • Relational calculus

    First-order logic over relation names, in tuple or domain form, used as the declarative query language of the relational model. Its answers depend on the domain unless the query is domain independent.

    core
  • Data complexity and combined complexity

    Vardi's measures of the cost of query evaluation: with the query fixed and only the database as input (data), with both as input (combined), or with the database fixed (expression).

    advanced
  • Domain-independent query

    A calculus query whose answer depends only on the database and not on the domain of values. The property is undecidable; the safe-range queries are a decidable subclass with the same power.

    advanced
  • Equality-generating dependency

    A first-order constraint that whenever some tuples are present, two of their values must be equal; functional dependencies are a case.

    advanced
  • Fifth normal form (5NF)

    A schema in which every nontrivial join dependency is implied by the candidate keys, so no lossless split into projections removes redundancy.

    advanced
  • Hypertree width

    A width measure of the hypergraph of a query; conjunctive queries of bounded hypertree width can be evaluated in polynomial time.

    advanced
  • Join dependency

    A constraint that a relation equals the natural join of its projections on given sets of attributes; an MVD is the case of two sets.

    advanced
  • Tuple-generating dependency

    A first-order constraint that whenever some tuples are present, tuples with possibly new values must be present too.

    advanced
  • Why-provenance and where-provenance

    The sets of input tuples that witness an output tuple, and the input locations from which each output value was copied.

    advanced
  • Fractional hypertree width

    The width of a tree decomposition whose bags are covered by fractional edge covers; bounded width gives polynomial time join evaluation.

    research

Theorems

  • Armstrong's axioms

    Reflexivity, augmentation and transitivity derive exactly the functional dependencies that a set of FDs implies: the rules are sound and complete (Armstrong 1974).

    1 languagescore
  • Codd's theorem

    Relational algebra and the domain-independent (or safe-range) relational calculus express exactly the same queries, under set semantics, and each translates into the other.

    core
  • Heath's theorem

    If X -> Y holds in a relation over the attributes XYZ, the relation is the join of its projections on XY and XZ. Fagin showed that the exact condition is the MVD X ->> Y.

    core
  • Chandra-Merlin theorem

    A conjunctive query Q1 is contained in Q2 if and only if there is a homomorphism from Q2 to Q1, if and only if the head of Q1 is an answer of Q2 on the canonical database of Q1.

    1 languagesadvanced
  • NP-completeness of the prime attribute problem

    Deciding whether an attribute belongs to some candidate key of a schema with functional dependencies is NP-complete (Lucchesi and Osborn 1978). Finding one key is easy.

    advanced
  • Sagiv-Yannakakis theorem

    A union of conjunctive queries is contained in another union exactly when each of its members is contained in some member of the other.

    advanced
  • Dalvi-Suciu dichotomy theorem

    Each union of conjunctive queries on a tuple-independent database can be evaluated in polynomial time by lifted rules or is #P-hard.

    research

Models

  • Entity-relationship model

    Chen's conceptual model of entities, attributes and relationships with cardinality constraints, and its mapping to relation schemas.

    intro
  • Relational data model

    Codd's model of data: a database is a finite set of relations, each a finite set of tuples over named attributes, with keys and other integrity constraints.

    intro
  • Datalog

    A query language of function-free Horn rules over relations. Its meaning is the least fixed point of the rules, which adds recursion to the select-project-join-union queries.

    advanced
  • Probabilistic database

    A database whose tuples are present with given probabilities; a query returns each answer with the probability that it holds.

    advanced
  • Provenance semirings

    Annotate tuples with elements of a commutative semiring and carry them through positive queries; provenance polynomials are the most general.

    advanced