Definitionadvanced
Equality-generating dependency
Also called EGD.
A first-order constraint that whenever some tuples are present, two of their values must be equal; functional dependencies are a case.
An equality-generating dependency (EGD) says that whenever some pattern of tuples occurs in a database, two values of that pattern are equal. The pattern is a conjunction of atoms, as in a conjunctive query. Every functional dependency and every key constraint is an EGD, but an EGD can also join several relations. Beeri and Vardi (1984) named the class, and it is one half of the embedded implicational dependencies of Fagin (1982). The other half are the tuple-generating dependencies. In the chase, an EGD makes two values equal, or fails when they are two different constants.
Definition
We use set semantics: a relation is a set of tuples.
Definition (Beeri and Vardi 1984). An equality-generating dependency is a first-order sentence
where is a nonempty conjunction of relational atoms and and are variables of . In ASCII it is written phi(x) -> x_i = x_j. A database satisfies the EGD if every valuation with has . The EGD is trivial if and are the same variable.
A conclusion with several equalities, , is the same as EGDs with the same body. Some authors also allow a constant on the right side, as in .
As a query. satisfies the EGD if and only if the conjunctive query returns only pairs of equal values on .
The chase step. If and differs from , the chase acts as follows.
- If is a labeled null, replace by everywhere in . If is a null and is a constant, replace by .
- If and are two different constants, the chase fails: no way of replacing the nulls of by values gives a database that satisfies the EGD.
Each step that does not fail makes the number of distinct values smaller by one. So a chase with EGDs alone stops after fewer steps than there are values in . In a test for implication, the values are the variables of a tableau, and they are all treated as nulls, so this chase never fails.
Examples and non-examples
- Functional dependency. On , the FD is the EGD
An FD with several attributes in is one EGD for each attribute of .
- Key. is a key of if and hold, which are two EGDs. See candidate key.
- Across two relations. With and , the EGD
says that the head of a department works in that department. It is not an FD, because its body has atoms of two relations.
- A chase step with nulls. Let with nulls and , and the FD . The chase replaces by , and becomes .
- A failing chase. with constants violates , and the chase fails. In data exchange, a failed chase with the target EGDs means that there is no solution.
- Non-example: inclusion dependency. "Each order has a known customer" asks for a tuple to exist, not for two values to be equal. It is an inclusion dependency, which is a TGD.
- Non-example: inequality. is not an EGD. It is a denial constraint, and the chase can not repair it by equating values.
Related definitions
- Tuple-generating dependency. A TGD has a conjunction of atoms as its conclusion. EGDs and TGDs together are the embedded implicational dependencies of Fagin.
- Functional dependency and Armstrong's axioms. FDs are the EGDs over one relation whose body has two atoms that share exactly the variables of the left side. Armstrong's axioms are complete for them, and attribute closure decides implication in linear time.
- Implication. For EGDs, possibly with full TGDs, the chase on the body of the goal stops and decides implication. With embedded TGDs the chase may not stop, and implication of TGDs and EGDs together is undecidable. See the dependency implication problem.
- Interaction with TGDs in the chase. Steps of EGDs and TGDs can alternate. An EGD step can make a TGD step needed or not needed, so the order of the steps can change the result, and with embedded TGDs it can change whether the chase stops. A chase that stops without failure gives a universal solution.
References
- Catriel Beeri and Moshe Y. Vardi, A proof procedure for data dependencies, Journal of the ACM 31(4), 718 to 741 (1984), equality-generating dependencies, and the chase step that equates two values
- Ronald Fagin, Horn clauses and database dependencies, Journal of the ACM 29(4), 952 to 985 (1982), embedded implicational dependencies with equalities in the conclusion
- Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 8 (functional and join dependency), the chase for functional dependencies, and Chapter 10 (a larger perspective), equality-generating dependencies
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 8F8GKB Edit this page History Report an error Markdown