MiniCon: A Scalable Algorithm for Answering Queries Using Views Rachel Pottinger and Alon Levy Affiliates Meeting February 24, 2000
Answering Queries Using Views uProblem: access views (stored queries) instead of original relations uUseful in data integration and query optimization uNP-Complete uMany papers on the subject uNo empirical testing of algorithms
Data Integration Used.com -Prices and years of used cars Used(price, year) :- Cost(model, price) & Age(model,year) Cheap.com -Prices of cars Cheap(price) :- Cost(model,price) Car Sale Information Query: What price do cars made in 1996 sell for? Query(Price, “1996”):- Cost(Model,Price) & Age(Model, “1996”)
View challenges uData sources (Cheap.com, Used.com) are pre-calculated views uViews are not complete uGet the most answers possible given the views uMany data sources
Inverse Rules uTake the views and invert them Cheap(price):- Cost(car,price) Cost(?,price) :- Cheap(price) uNow can query on database relations to find all relevant rules uRun regular database functions to find answers uExtended to be more efficient in our paper
Bucket Algorithm: Populating buckets ¶For each relation in the query, place relevant views in the relation’s bucket Inputs: Query(Price,“1996”):- Cost(Model,Price) & Age(Model,“1996”) Cheap(price):-Cost(model,price) Used(price,year):-Cost(model,price) & Age(model,year) Age(Model, “1996”) Used(_, “1996”) Buckets: Cost(Model,Price) Cheap(Price) Used(Price,_)
Combining Buckets ËFor every combination in the Cartesian products from the buckets, check containment in the query Candidate rewritings: Query’ 1 (x) :- Cheap(Price) & Used(_, “1996”) Query’ 2 (x) :- Used(Price,_) & Used(_, “1996”) Bucket Algorithm will check all possible combinations Buckets: Age(Model, “1996”) Used(_, “1996”) Cost(Model,Price) Cheap(Price) Used(Price,_)
The MiniCon Algorithm Concentrate on variables rather than relations to create MiniCon Descriptions (MCDs) Combine MCDs that only overlap on returned view variables
MiniCon Description Formation ¶Form all MiniCon Descriptions (MCDs) that map all query variables that have to be mapped together Inputs: Query(Price,“1996”):- Cost(Model,Price) & Age(Model,“1996”) Cheap(price):-Cost(model,price) Used(price,year):-Cost(model,price) & Age(model,year) viewmappingrelations mapped Used Model model, 1, 2 Price price, “1996” year MCDs:
MiniCon Combination Take all combinations of MCDs that ¶ map disjoint sets of relations · map all relations of the query MCDs: Rewriting: Query’(Price,“1996”):-Used(Price, “1996”) viewmappingrelations mapped Used Model model, 1, 2 Price price, “1996” year
Experimental results: Many rewritings
Experimental Results: Few rewritings
See paper for details Including: uFurther experimental evaluation uExtension to handle interpreted predicates uImprovement to Inverse Rules uQuery optimization extension