Modeladvanced
Probabilistic database
Also called tuple-independent probabilistic database.
A database whose tuples are present with given probabilities; a query returns each answer with the probability that it holds.
A probabilistic database is a database in which each tuple is present only with some probability, so that the database stands for a probability distribution over ordinary instances, its possible worlds. A query returns each answer together with its marginal probability, the total probability of the worlds in which the answer holds. The common models are tuple-independent databases, where the tuples are independent events, and block-independent-disjoint databases, where the tuples of a block exclude each other. Computing the probability of a query answer is a weighted counting problem, #P-hard in general, and for some queries it can be done in polynomial time by rules that use independence.
The machine
The setting is the relational model under set semantics, with a fixed schema; the notation is that of relational algebra.
Possible worlds. A probabilistic database is a pair of a finite set of instances, the possible worlds, and a probability distribution on , so and . Listing the worlds is not practical, so the models below describe by a table.
Tuple-independent databases (TID). Each relation is a set of tuples, and each tuple carries a probability with . Let be the set of all these tuples. The possible worlds are all subsets , with
So each tuple is present with probability , independently of the others. A database with tuples has worlds, all described by numbers. A tuple with is certain, and a relation all of whose tuples are certain is deterministic.
Block-independent-disjoint databases (BID). The tuples of a relation are split into blocks, usually the tuples with the same key. In a world, at most one tuple of each block is present: tuple of block with probability , and no tuple of with probability , so the probabilities in a block sum to at most 1. Different blocks are independent. A TID is the BID in which every block has one tuple. BIDs express attributes with an uncertain value, such as a city that is Paris with probability or Rome with probability .
Queries. A query of the relational calculus or algebra is evaluated in each world. For a Boolean query,
For a query with free variables, each candidate answer gets the probability of the Boolean query obtained by substituting . The output is the set of pairs with . The query itself is an ordinary query; only the evaluation changes.
Lineage. For a union of conjunctive queries on a TID, introduce a Boolean variable for each tuple , meaning " is present". The lineage is the DNF formula with one conjunction for each set of tuples that together make true, that is, the disjunction over the witnesses of (see why-provenance). A world satisfies exactly when its tuples satisfy , so when each is true independently with probability . The lineage is the provenance of in the semiring of positive Boolean formulas (see provenance semirings), and for a fixed it has polynomial size in the database.
What it counts
The model assigns to each answer a probability, the weight of the set of worlds in which it holds. For a TID and a union of conjunctive queries this is the probability of a monotone DNF formula under independent variables, which is a weighted model count: the sum, over the satisfying assignments of , of the product of for true variables and for false ones (see model counting). With all , is the number of satisfying assignments.
Example. A TID with and :
| tuple | |
|---|---|
| 0.5 | |
| 0.4 | |
| 0.6 | |
| 0.5 | |
| 0.2 |
The Boolean query has the lineage . The two values of use disjoint tuples, so they are independent:
- for : ;
- for : ;
- so .
Summing over the worlds that satisfy gives the same 0.448.
A wrong plan. Compute the join first, with probability , with and with , and then treat the three join tuples as independent in the projection: . This is wrong, because the first two join tuples share and are not independent. The plan that projects away inside before the join, as above, gives the right answer. Plans whose every step respects independence are the safe plans of Dalvi and Suciu (2004).
Relation to other models
- Incomplete databases. An incomplete database is a set of possible worlds without probabilities; its certain answers are the answers true in every world. A probabilistic database adds a distribution, and an answer has probability 1 exactly when it is true in every world with positive probability.
- Provenance semirings. Query evaluation by lineage is evaluation in the semiring of positive Boolean formulas, followed by a probability computation that is not a semiring homomorphism: only when and share no variable. See provenance semirings.
- Knowledge compilation. Intensional evaluation compiles into a form with linear-time probability computation, such as a d-DNNF or an ordered binary decision diagram, by Shannon expansion and decomposition into independent parts. The cost is the size of the compiled form.
- Graphical models. A TID is the simplest probabilistic model, with all variables independent. Correlations are added by richer representations, for example by conditions on tuples or by factors over tuples as in a factor graph; query evaluation then becomes inference in that model.
Known results in the model
All results are in data complexity: the query is fixed and the input is the database with its probabilities (see data and combined complexity).
- Hardness in general. Computing is in for every fixed query of the relational calculus, by summing over the worlds with a #P oracle. It is #P-hard for some fixed conjunctive queries, already for on a TID (Dalvi and Suciu 2004).
- Dichotomy. For unions of conjunctive queries on TIDs, each query is either computable in polynomial time by the lifted inference rules (independent join, independent union, independent project, inclusion-exclusion) or #P-hard. For conjunctive queries without self-joins, the polynomial ones are exactly the hierarchical ones. This is the Dalvi-Suciu dichotomy.
- Extensional evaluation. The lifted rules compute from the probabilities of smaller queries, without building the lineage. For a fixed query that the rules accept, the time is polynomial in the database (Suciu, Olteanu, Re and Koch 2011, Chapter 4).
- Intensional evaluation. Every query can be evaluated by computing and then its probability, by compilation or by exact model counting. The time is exponential in the worst case.
- Approximation. For a union of conjunctive queries, is a DNF of polynomial size, and the probability of a DNF under independent variables has a fully polynomial randomized approximation scheme, by the estimator of Karp, Luby and Madras (1989) (see Karp-Luby algorithm and FPRAS). So can be approximated within a factor with high probability in time polynomial in the database and , also for the #P-hard queries.
- BID databases. The rules extend to BIDs, with one more rule that adds the probabilities of the disjoint tuples of a block (Suciu, Olteanu, Re and Koch 2011, Chapter 4). A TID is a BID, so every query that is #P-hard on TIDs stays #P-hard on BIDs.
References
- Dan Suciu, Dan Olteanu, Christopher Re and Christoph Koch, Probabilistic Databases, Synthesis Lectures on Data Management, Morgan and Claypool (2011), Chapter 2 (possible worlds, tuple-independent and block-independent-disjoint databases), Chapter 3 (the query evaluation problem and lineage), Chapter 4 (extensional evaluation and the lifted rules), Chapter 5 (intensional evaluation and compilation)
- Nilesh Dalvi and Dan Suciu, Efficient query evaluation on probabilistic databases, Proceedings of the 30th International Conference on Very Large Data Bases (VLDB), 864 to 875 (2004), the possible worlds semantics for independent tuples, safe plans, and the
- Nilesh Dalvi and Dan Suciu, Efficient query evaluation on probabilistic databases, The VLDB Journal 16(4), 523 to 544 (2007), journal version, with the dichotomy for conjunctive queries without self-joins
- Richard M. Karp, Michael Luby and Neal Madras, Monte-Carlo approximation algorithms for enumeration problems, Journal of Algorithms 10(3), 429 to 448 (1989), the union of sets estimator, which approximates the probability of a DNF formula
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 1X7PAG Edit this page History Report an error Markdown