1 / 15

Answering Queries and Hypertree Decompositions

Answering Queries and Hypertree Decompositions. Conjunctive Queries. The problem BCQ:. Instance: < DB, Q>. Question: Has Q a nonempty result over DB?. Combined Complexity (Vardi ’82). Problems Equivalent to BCQ. Conjunctive Query Containment Query of Tuple Problem

bonner
Download Presentation

Answering Queries and Hypertree Decompositions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Answering Queriesand Hypertree Decompositions

  2. Conjunctive Queries The problem BCQ: Instance: < DB, Q> Question: Has Q a nonempty result over DB? Combined Complexity(Vardi ’82)

  3. Problems Equivalent to BCQ • Conjunctive Query Containment • Query of Tuple Problem • Constraint Satisfaction in AI • Clause Subsumption in Theorem Proving

  4. Example of CSP: Crossword Puzzle

  5. Complexity of BCQ • NP-complete in the general case (Chandra and Merlin ’77)NP-hard even for fixed database • Polynomial if Q has an acyclic hypergraph(Yannakakis ’81)LOGCFL-complete (in NC2) (G.L.S. ’98) Interest in larger tractable classes of CQS

  6. Is this query hard? n size of the database m number of atoms in the query m = 11 ! O(n m) • Classical methods worst-case complexity: • Despite its apparence, this query is nearly acyclic It can be evaluated in O(m·n 2·logn)

  7. Nearly Acyclic Queries • Bounded Treewidth (tw) • a measure of the cyclicity of graphs • for queries: tw(Q) = tw(G(Q)) • For fixed k: • checking tw(Q) k • Computing a tree decomposition linear time (Bodlaender’96) • Answering BCQ of treewidth k: O(nk log n) (Chekuri & Rajaraman’97) LOGCFL-complete (G.L.S.’98)

  8. Beyond treewidth Bounded Degree of Cyclicity (Gyssens & Paredaens ’84) Bounded Query width (Chekuri & Rajaraman ’97) Group together query atoms (hyperedges) instead of variables

  9. Hypertree Decomposition p(X,Y,Z), q(U,V,Z) p(X,Y,Z), q(U,V,Z) We group atoms a(X,U,W), b(Y,V,W) p(X,Y,_), c(T,W) p(X,Y,_), c(T,W) We use p(X,Y,Z) partially d(X,T) c(Y,T)

  10. j(J,X,Y,X’,Y’) a(S,X,X’,C,F), b(S,Y,Y’,C’,F’) j(_,X,Y,_,_), c(C,C’,Z) j(_,_,_,X’,Y’), f(F,F’,Z’) d(X,Z) e(Y,Z) g(X’,Z’), f(F,_,Z’) h(Y’,Z’) p(B,X’,F) q(B’,X’,F)

  11. Connectedness Condition j(J,X,Y,X’,Y’) a(S,X,X’,C,F), b(S,Y,Y’,C’,F’) j(_,X,Y,_,_), c(C,C’,Z) j(_,_,_,X’,Y’), f(F,F’,Z’) d(X,Z) e(Y,Z) g(X’,Z’), f(F,_,Z’) h(Y’,Z’) p(B,X’,F) q(B’,X’,F)

  12. Evaluating queries having bounded hypertree width k fixed Given: a database db a query Q over db such that hw(Q)  k a width k hypertree decomposition of Q • Deciding whether Q(db) is not empty is in O(n k+1log n) and complete for LOGCFL • Computing Q(db) is feasible in output-polynomial time

  13. Comparison results Hypertree Decomposition Hinge Decomposition + Tree Clustering Cycle Hypercutset HingeDecomposition Tree Clusteringw*  treewidth Biconnected Components Cycle Cutset

  14. Characterizations ofHypertree width • Logical characterization: Loosely guarded logic • Game characterization: The robber and marshals game

  15. Work in progress • Answering queries and hypertree decompositions: • A query-planner based on hypertree decompositions • Choosing the best query plan (i.e., the best decomposition) exploiting data on tables, attibute selectivity, indices, etc. • Further possible applications: • Answering queries using views

More Related