{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

kassoff-CQ - Information Integration Lecture 12 Query...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Query Folding Information Integration Lecture 12 Michael Kassoff Spring 2003
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Answering Queries Using Resources book.title book.author book.year books(b, t, y) :- b.title(b, t), b.author(b, JDS), b.year(b, y) q(t, a) :- b.title(b, t), b.author(b, a) materialized: empty base relations:
Background image of page 2
Answering Queries Using Resources book.title book.author book.year books(b, t, y) :- b.title(b, t), b.author(b, JDS), b.year(b, y) q(t, a) :- b.title(b, t), b.author(b, a) materialized: empty base relations:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Running Example Book.Title Book.Author Book.Printing Printing.Date Pivot Schema loc(b, t, a) :- b.title(b, t), b.author(b, a) fan(b, d) :- b.author(b, JDS), b.printing(b, p), p.date(p, d) Resources
Background image of page 4
Query Plans Resources: Query: q(t, a) :- b.title(b, t), b.author(b, a), b.printing(b, p), p.date(p, 1951) loc(b, t, a) :- b.title(b, t), b.author(b, a) fan(b, d) :- b.author(b, JDS), b.printing(b, p), p.date(p, d) Query plan: q(t, a) :- loc(b, t, a), fan(b, 1951)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Query Folding Treat intensional predicates as being extensional q(t, a) :- loc(b, t, a), fan(b, 1951) loc(b, t, a) :- b.title(b, t), b.author(b, a) fan(b, 1951) :- b.author(b, JDS), b.printing(b, p), p.date(p, 1951) q(t, a) :- b.title(b,t), b.author(b, a), b.printing(b, p), p.date(p, 1951) folded query:
Background image of page 6
Query Containment A query Q 1 is contained in another query Q 2 if Q 1 ( D ) Q 2 ( D ) for all databases D – Denoted Q 1 Q 2 Two queries are equivalent if Q 1 Q 2 and Q 2 Q 1 – Denoted Q 1 Q 2
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Maximal Containment Can’t always find an equivalent query plan We’ll settle for a maximally-contained plan A query plan Q* is maximally-contained in Q if: Q* Q There is no rewriting Q’ such that Q* Q’ Q and Q’ is not equivalent to Q * Maximal-containment is relative to the query language allowed (i.e., conjunctive, recursive)
Background image of page 8
Answering Queries Using Resources We will look at 2 methods: Bucket Algorithm Inverse Rules
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The Bucket Algorithm High level idea: we need to extract tuples from the resources to plug into the subgoals of our query Q Create a bucket for each subgoal of Q Fill the bucket with potential sources of tuples for
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}