• Aucun résultat trouvé

Query Evaluation on Probabilistic Data: New Hard Cases

N/A
N/A
Protected

Academic year: 2022

Partager "Query Evaluation on Probabilistic Data: New Hard Cases"

Copied!
107
0
0

Texte intégral

(1)

Query Evaluation on Probabilistic Data:

New Hard Cases

Antoine Amarilli1, joint work with Benny Kimelfeld2, İsmail İlkan Ceylan3 October 10, 2019

1Télécom Paris

2Technion

3University of Oxford

(2)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data

(3)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data

(4)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data

(5)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data

(6)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data

(7)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data

(8)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay

A.

B.

Télécom Paris

Paris Sud

Technion

ParisTech

IP Paris

Paris-Saclay

→ Problem:we may beuncertainabout the data

(9)

Uncertain data management

Databases:managedataand answerqueriesover it

In this talk,datais simply a labeled graph WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud Benny Technion İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we may beuncertainabout the data 2/17

(10)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

80% 10%

40% 80%

100%

90% 90% 50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

→ This model issimplistic, but already challenging to understand

(11)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

→ This model issimplistic, but already challenging to understand

(12)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

→ This model issimplistic, but already challenging to understand

(13)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

→ This model issimplistic, but already challenging to understand

(14)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

80% 10%

40% 80%

100%

90% 90% 50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

→ This model issimplistic, but already challenging to understand

(15)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

80% 10%

40% 80%

100%

90% 90% 50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?

0.03%

→ This model issimplistic, but already challenging to understand

(16)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?

0.03%

→ This model issimplistic, but already challenging to understand

(17)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

→ This model issimplistic, but already challenging to understand

(18)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Every fact carries aprobability

Every fact exists with the indicatedprobability

All facts areindependent

Possible world:subset of facts

What isprobabilityof this possible world?0.03%

(19)

Queries

Query:maps anon-probabilisticgraph to YES/NO

Conjunctive query:can I find an occurrence of apattern?

x y z

• We want ahomomorphismfrom the pattern to the graph

• Not necessarilyinjective!

Union of conjunctive queries: does one of the patterns match?

Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

(20)

Queries

Query:maps anon-probabilisticgraph to YES/NO

Conjunctive query:can I find an occurrence of apattern?

x y z

• We want ahomomorphismfrom the pattern to the graph

• Not necessarilyinjective!

Union of conjunctive queries: does one of the patterns match?

Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

(21)

Queries

Query:maps anon-probabilisticgraph to YES/NO

Conjunctive query:can I find an occurrence of apattern?

x y z

• We want ahomomorphismfrom the pattern to the graph

• Not necessarilyinjective!

Union of conjunctive queries: does one of the patterns match?

Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

(22)

Queries

Query:maps anon-probabilisticgraph to YES/NO

Conjunctive query:can I find an occurrence of apattern?

x y z

• We want ahomomorphismfrom the pattern to the graph

• Not necessarilyinjective!

Union of conjunctive queries: does one of the patterns match?

Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

(23)

Queries

Query:maps anon-probabilisticgraph to YES/NO

Conjunctive query:can I find an occurrence of apattern?

x y z

• We want ahomomorphismfrom the pattern to the graph

• Not necessarilyinjective!

Union of conjunctive queries: does one of the patterns match?

Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

(24)

Queries

Query:maps anon-probabilisticgraph to YES/NO

Conjunctive query:can I find an occurrence of apattern?

x y z

• We want ahomomorphismfrom the pattern to the graph

• Not necessarilyinjective!

Union of conjunctive queries: does one of the patterns match?

Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

(25)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance: x y z

Theinputis a TID: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40% 80%

100%

90% 90% 50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(26)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance: x y z

Theinputis a TID: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(27)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance: x y z

Theinputis a TID: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(28)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance: x y z

Theinputis a TID: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(29)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance: x y z

Theinputis a TID: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(30)

Existing results

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

Our example query x y z is...safe Also: dichotomy on theinstance families:

Theorem [Amarilli et al., 2015, Amarilli et al., 2016]

For any queryQinmonadic second-order logic,PQE(Q)is in PTIMEif the input TIDs havebounded treewidth

There is a queryQsuch thatPQE(Q)is#P-hardon any TID family ofunbounded treewidth(with several technical assumptions)

(31)

Existing results

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

Our example query x y z is...

safe

Also: dichotomy on theinstance families:

Theorem [Amarilli et al., 2015, Amarilli et al., 2016]

For any queryQinmonadic second-order logic,PQE(Q)is in PTIMEif the input TIDs havebounded treewidth

There is a queryQsuch thatPQE(Q)is#P-hardon any TID family ofunbounded treewidth(with several technical assumptions)

(32)

Existing results

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

Our example query x y z is...safe

Also: dichotomy on theinstance families:

Theorem [Amarilli et al., 2015, Amarilli et al., 2016]

For any queryQinmonadic second-order logic,PQE(Q)is in PTIMEif the input TIDs havebounded treewidth

There is a queryQsuch thatPQE(Q)is#P-hardon any TID family ofunbounded treewidth(with several technical assumptions)

(33)

Existing results

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

Our example query x y z is...safe Also: dichotomy on theinstance families:

Theorem [Amarilli et al., 2015, Amarilli et al., 2016]

For any queryQinmonadic second-order logic,PQE(Q)is in PTIMEif the input TIDs havebounded treewidth

There is a queryQsuch thatPQE(Q)is#P-hardon any TID family ofunbounded treewidth(with several technical assumptions)

(34)

Existing results

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

Our example query x y z is...safe Also: dichotomy on theinstance families:

Theorem [Amarilli et al., 2015, Amarilli et al., 2016]

For any queryQinmonadic second-order logic,PQE(Q)is in PTIMEif the input TIDs havebounded treewidth

(35)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(36)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(37)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(38)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(39)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(40)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(41)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(42)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(43)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2 1

1 1

1

1

(44)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b02 1/2

1/2

1 1

1 1

1

(45)

Why are some queries unsafe?

This query isunsafe: x y z w

#SAT: counting satisfying valuations of a Boolean formula

Specifically, reduce from#PP2DNF:

Partitionedvariables:X1, . . . ,XnandY1, . . . ,Ym

Positive: no negation

2-DNF: disjunction of clauses likeXiYj

#SATis already#P-hard

Example:(X1Y1)(X1Y2)(X2Y2)(X3Y1)(X3Y2)

a01

a02

a03

a1

a2

a3 1/2 1/2 1/2

b1

b2

b01

b0 1/2

1/2 1

1 1

1

1 7/17

(46)

New results in this talk

We presentmore caseswhere PQE is#P-hard:

With İsmail İlkan Ceylan, forexpressive queries: Theorem [Amarilli and Ceylan, 2019]

For anyquery Q closed under homomorphisms,PQE(Q)is#P-hard unlessQis equivalent to asafe UCQ

With Benny Kimelfeld, in theunweighted case: Theorem [Amarilli and Kimelfeld, 2019]

For anyCQ Q without self-joins(every edge has a different color), if Qis unsafe thenPQE(Q)is#P-hardeven if all probabilities are1/2

(47)

New results in this talk

We presentmore caseswhere PQE is#P-hard:

With İsmail İlkan Ceylan, forexpressive queries: Theorem [Amarilli and Ceylan, 2019]

For anyquery Q closed under homomorphisms,PQE(Q)is#P-hard unlessQis equivalent to asafe UCQ

With Benny Kimelfeld, in theunweighted case: Theorem [Amarilli and Kimelfeld, 2019]

For anyCQ Q without self-joins(every edge has a different color), if Qis unsafe thenPQE(Q)is#P-hardeven if all probabilities are1/2

(48)

Hardness for queries closed under

homomorphisms

(49)

Result statement

We consider queriesclosed under homomorphisms:

GeneralizesCQsandUCQs,Datalog,Regular path queries...

• Example:WorksAt/MemberOf+

Equivalent phrasing:infiniteunion of CQs

• Example:WA/MO,WA/MO/MO,WA/MO/MO/MO, ... Theorem

Some queries closed under homomorphisms areUCQs: the previous dichotomy applies, PQE isPTIMEor#P-hard

Forall other queries closed under homomorphisms, PQE is#P-hard

The queryWA/MO+ isequivalenttoWA/MOwhich is asafe UCQ

The queryWA/MO+/INisnot equivalent to a UCQ so PQE is#P-hard

(50)

Result statement

We consider queriesclosed under homomorphisms:

GeneralizesCQsandUCQs,Datalog,Regular path queries...

• Example:WorksAt/MemberOf+

Equivalent phrasing:infiniteunion of CQs

• Example:WA/MO,WA/MO/MO,WA/MO/MO/MO, ... Theorem

Some queries closed under homomorphisms areUCQs: the previous dichotomy applies, PQE isPTIMEor#P-hard

Forall other queries closed under homomorphisms, PQE is#P-hard

The queryWA/MO+ isequivalenttoWA/MOwhich is asafe UCQ

The queryWA/MO+/INisnot equivalent to a UCQ so PQE is#P-hard

(51)

Result statement

We consider queriesclosed under homomorphisms:

GeneralizesCQsandUCQs,Datalog,Regular path queries...

• Example:WorksAt/MemberOf+

Equivalent phrasing:infiniteunion of CQs

• Example:WA/MO,WA/MO/MO,WA/MO/MO/MO, ...

Theorem

Some queries closed under homomorphisms areUCQs: the previous dichotomy applies, PQE isPTIMEor#P-hard

Forall other queries closed under homomorphisms, PQE is#P-hard

The queryWA/MO+ isequivalenttoWA/MOwhich is asafe UCQ

The queryWA/MO+/INisnot equivalent to a UCQ so PQE is#P-hard

(52)

Result statement

We consider queriesclosed under homomorphisms:

GeneralizesCQsandUCQs,Datalog,Regular path queries...

• Example:WorksAt/MemberOf+

Equivalent phrasing:infiniteunion of CQs

• Example:WA/MO,WA/MO/MO,WA/MO/MO/MO, ...

Theorem

Some queries closed under homomorphisms areUCQs:

the previous dichotomy applies, PQE isPTIMEor#P-hard

Forall other queries closed under homomorphisms, PQE is#P-hard

The queryWA/MO+ isequivalenttoWA/MOwhich is asafe UCQ

The queryWA/MO+/INisnot equivalent to a UCQ so PQE is#P-hard

(53)

Result statement

We consider queriesclosed under homomorphisms:

GeneralizesCQsandUCQs,Datalog,Regular path queries...

• Example:WorksAt/MemberOf+

Equivalent phrasing:infiniteunion of CQs

• Example:WA/MO,WA/MO/MO,WA/MO/MO/MO, ...

Theorem

Some queries closed under homomorphisms areUCQs:

the previous dichotomy applies, PQE isPTIMEor#P-hard

Forall other queries closed under homomorphisms, PQE is#P-hard

The queryWA/MO+isequivalenttoWA/MOwhich is asafe UCQ

The queryWA/MO+/INisnot equivalent to a UCQ so PQE is#P-hard

(54)

Result statement

We consider queriesclosed under homomorphisms:

GeneralizesCQsandUCQs,Datalog,Regular path queries...

• Example:WorksAt/MemberOf+

Equivalent phrasing:infiniteunion of CQs

• Example:WA/MO,WA/MO/MO,WA/MO/MO/MO, ...

Theorem

Some queries closed under homomorphisms areUCQs:

the previous dichotomy applies, PQE isPTIMEor#P-hard

Forall other queries closed under homomorphisms, PQE is#P-hard

The queryWA/MO+isequivalenttoWA/MOwhich is asafe UCQ

(55)

Proof idea: finding hard patterns

Fix the queryQand find atight pattern, i.e,. a graph such that:

• •

• satisfiesQ

but •

• violatesQ

If the query isunbounded, we can find atight pattern

• Unbounded queries havearbitrarily largeminimal models

• Take one such model anddisconnect edgesas much as possible

• Unbounded queries havearbitrarily largeminimal models

to

to

to

• IfQis still true then the model is “explained” by aunion of stars

(56)

Proof idea: finding hard patterns

Fix the queryQand find atight pattern, i.e,. a graph such that:

• •

• satisfiesQ

but •

• violatesQ

If the query isunbounded, we can find atight pattern

• Unbounded queries havearbitrarily largeminimal models

• Take one such model anddisconnect edgesas much as possible

• Unbounded queries havearbitrarily largeminimal models

to

to

to

• IfQis still true then the model is “explained” by aunion of stars

(57)

Proof idea: finding hard patterns

Fix the queryQand find atight pattern, i.e,. a graph such that:

• •

• satisfiesQ

but •

• violatesQ

If the query isunbounded, we can find atight pattern

• Unbounded queries havearbitrarily largeminimal models

• Take one such model anddisconnect edgesas much as possible

• Unbounded queries havearbitrarily largeminimal models

to

to

to

• IfQis still true then the model is “explained” by aunion of stars

(58)

Proof idea: finding hard patterns

Fix the queryQand find atight pattern, i.e,. a graph such that:

• •

• satisfiesQ

but •

• violatesQ

If the query isunbounded, we can find atight pattern

• Unbounded queries havearbitrarily largeminimal models

• Take one such model anddisconnect edgesas much as possible

• Unbounded queries havearbitrarily largeminimal models

to

to

to

• IfQis still true then the model is “explained” by aunion of stars

(59)

Proof idea: finding hard patterns

Fix the queryQand find atight pattern, i.e,. a graph such that:

• •

• satisfiesQ

but •

• violatesQ

If the query isunbounded, we can find atight pattern

• Unbounded queries havearbitrarily largeminimal models

• Take one such model anddisconnect edgesas much as possible

• Unbounded queries havearbitrarily largeminimal models

to

to

to

• IfQis still true then the model is “explained” by aunion of stars

(60)

Proof idea: finding hard patterns

Fix the queryQand find atight pattern, i.e,. a graph such that:

• •

• satisfiesQ

but •

• violatesQ

If the query isunbounded, we can find atight pattern

• Unbounded queries havearbitrarily largeminimal models

• Take one such model anddisconnect edgesas much as possible

• Unbounded queries havearbitrarily largeminimal models

to

to

to

• IfQis still true then the model is “explained” by aunion of stars

Références

Documents relatifs

Strictly montone functions are the easiest imaginable testbed for hillclimbers: The function f always prefers one-bits over zero-bits, so there are always short and clearly

It turns out that even for HL already generating the lexicographically first MinA is intractable, thus unless p = np , MinAs cannot be enumerated in a specified lexi- cographic

En permutant A et B dans la question 3, on voit que e séquent n'est pas prouvable

[r]

∗ Cabello and Mohar [2] exploit a slightly different property to compute shortest nontrivial cycles more quickly on surfaces of constant genus: the desired shortest cycle crosses

For example, RS ω u (MITL) is the reactive synthesis problem where the inputs are a formula of MITL and a plant, which are interpreted over the infinite words semantics, and where

• Our result: PQE(Q) is #P-hard for any query Q closed under homomorphisms unless it is equivalent to a safe UCQ. → Dichotomy for probabilistic query evaluation over

system this gives a connection to approximation of optimization problems as follows (for (1) ZPP is that class of problems which can be solved in expected polynomial time