What is a database closure?

Viewed 32126

I came across this term called database closure.

I tried to look for it and what exactly it means but I have not found any simple explanation.

Can someone please explain what the concept of closure is and specifically what is a database closure, if it is good /bad, how it can be used or avoided ?

Also seems like there is in general a closure term: http://en.wikipedia.org/wiki/Closure_%28computer_science%29 which relates to binding of variables to function. Is a database closure related to this ?

Thanks!

5 Answers

The closure is essentially the full set of attributes that can be determined from a set of known attributes, for a given database, using its functional dependencies.

Formal math definition:

Given a set of functional dependencies, F, and a set of attributes X. The closure is defined to be the set of attributes Y such that X -> Y follows from F.

Algorithm definition:

Closure(X, F)
1  INITIALIZE V:= X
2  WHILE there is a Y -> Z in F such that:
   - Y is contained in V and
   - Z is not contained in V
3       DO add Z to V
4  RETURN V

It can be shown that the two definition coincide.

A database closure might refer to the closure of all of the database attributes. According to the definitions above, this closure would be the set of all attributes of the database itself.

The closure (computer science) term that you linked to is not related to closure in databases but the mathematical closure is.

For a better understanding of functional dependencies and a simple example for closure in databases I suggest reading this.

Related