Conjunctive Queries
Conjunctive Queries
Conjunctive Queries
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Conjunctive</strong>Queryevaluation<br />
CQminimization<br />
THEOREM:BCQisNPComplete(combinedcomplexity)<br />
Proof:FollowsfromtheNPcompletenessofHOM<br />
Exercise: AsanalternativeproofofNPhardness,givea<br />
reductionfrom3SAT.<br />
COROLLARY: <strong>Conjunctive</strong>QueryContainmentisNPcomplete<br />
COROLLARY: <strong>Conjunctive</strong>QueryEquivalenceisNPcomplete<br />
•AconjunctivequeryQisminimal,ifitcontains<br />
minimalnumberofsubgoals –<br />
(subgoal=bodyatom)<br />
Thismeans:whenewerwedropanatom<br />
fromthebodyofQ,wegetaqueryQ’Q<br />
•ThetaskoftheCQminimization:minimizethe<br />
numberofsubgoals ofagivenCQ.<br />
Note:ThelatterproblemsareundecidableforFO 37<br />
38<br />
Cores<br />
Cores<br />
endomorphism h: {Y b}<br />
BCQ:<br />
Pp(X,Y), p(X,b), p(a,b), p(U,c), p(U,V), q(a,c,d)<br />
B= { p(X,Y), p(X,b), p(a,b), p(U,c), p(U,V), q(a,c,d)}<br />
{ p(X,Y), p(X,b), p(a,b), p(U,c), p(U,V), q(a,c,d) }<br />
Logical meaning<br />
X, Y, U, V:<br />
p(X,Y) & p(X,b) &<br />
p(a,b) & p(U,c) & p(U,V) & q(a,c,d)<br />
39<br />
40