Tiresias
description
Transcript of Tiresias
![Page 1: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/1.jpg)
University of WashingtonDatabase Group
TiresiasThe Database Oracle for How-To Queries
Alexandra Meliou§✜
Dan Suciu✜
§University of Massachusetts Amherst✜University of Washington
![Page 2: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/2.jpg)
Hypothetical (What-if) Queries
Brokerage companyDB
Key Performance Indicators (KPI)
Example from [Balmin et al. VLDB’00]:“An analyst of a brokerage company wants to know what would be the effect on the return of customers’ portfolios if during the last 3 years they had suggested Intel stocks instead of Motorola.”
change something in the source (hypothesis)
observe the effect in the target
forward
![Page 3: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/3.jpg)
How-To Queries
Brokerage companyDB
Key Performance Indicators (KPI)
Modified example:“An analyst wants to ask how to achieve a 10% return in customer portfolios, with the least number of trades.”
find changes to the source that achieve the desired effect
declare a desired effect in the target
reverse
![Page 4: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/4.jpg)
TPC-H example A manufacturing company keeps records of
inventory orders in a LineItem table. KPI: Cannot order more than 7% of the inventory
from any single country
Can reassign orders to new suppliers as long as the supplier can supply the part
Minimize the number of changes
(constraints)
(variables)
(optimization objective) constraint optimization
![Page 5: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/5.jpg)
extract data
Constraint Optimization on Big Data
DB
construct optimization model
this is for a set of 10 lineitems and 40
suppliers
Mixed Integer Programming (MIP)
solver
transform into data updates
MathProg
Impractical!
![Page 6: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/6.jpg)
Demo: Tiresias
a tool that makes how-to queries practical
![Page 7: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/7.jpg)
Tiresias: How-To Query Engine
DBMS
MIPsolver
Tiresias
TiQL (Tiresias Query Language)
Declarative interface, extension to Datalog
![Page 8: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/8.jpg)
Overview
MathProgor AMPL
TiQL
Visualizations
![Page 9: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/9.jpg)
MathProg or AMPL
TiQL
Visualizations
Overview
Demo
![Page 10: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/10.jpg)
Demo
MathProgor AMPL
TiQL
Visualizations
Overview
Language semantics
Evaluation of a TiQL program: Translation from TiQL to linear constraints
Performance optimizations
![Page 11: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/11.jpg)
Tiresias Query Language Datalog-like notation:
TiQL semantics:Mapping from EDBs (Extensional Database) to possible worlds over HDBs (Hypothetical Database)
head body: conjunction of predicates
HDB
![Page 12: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/12.jpg)
TiQL Rules
Reduction Rule
Constraint Rule
Deduction RuleSemantics: Similar to repair-key semantics [Antonova et al. SIGMOD’07], [Koch ICDT’09]
Semantics: Takes a subset of tuples
Semantics: The head predicate needs to hold for all tuples
![Page 13: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/13.jpg)
Demo
MathProgor AMPL
TiQL
Visualizations
Overview
Language semantics
Evaluation of a TiQL program: Translation from TiQL to linear constraints
Performance optimizations
![Page 14: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/14.jpg)
Evaluating a TiQL Program
Mixed Integer Program(MIP)
TiQL
DB
![Page 15: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/15.jpg)
Evaluating a TiQL Program
possible worlds
![Page 16: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/16.jpg)
Key Constraints
NOT a possible world
![Page 17: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/17.jpg)
Provenance Constraints A TiQL rule specifies transformations Transformations define provenance
Boolean semantics for queries without aggregates Semi-module provenance for queries with
aggregates [Amsterdamer et al. PODS’11]
Disjunction: Conjunction:
![Page 18: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/18.jpg)
Demo
MathProgor AMPL
TiQL
Visualizations
Overview
Language semantics
Evaluation of a TiQL program: Translation from TiQL to linear constraints
Performance optimizations
![Page 19: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/19.jpg)
Optimizing Performance Model optimizer
eliminates variables, constraints, and parameters uses key constraints, functional dependencies, and
provenance
Partitioning optimizerSignificantly faster than letting the MIP solver do it
![Page 20: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/20.jpg)
Evaluation of the Model Optimizer
baseline
with optimization
![Page 21: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/21.jpg)
Evaluation of Tiresias Partitioning
10k tuples 1M tuples
granularity of partitioning
complex dependency on the granularity of partitioning
![Page 22: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/22.jpg)
Scalability
The MIP solver runtime (per partition) does not increase
with data size
Constructor time depends on DB query execution time
![Page 23: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/23.jpg)
Related Work Provenance
[Amsterdamer et al. PODS’11], [Cui et al. TODS’00], [Green et al. PODS’07]
Incomplete databases[Antonova et al. SIGMOD’07], [Imielinski et al. JACM’84], [Koch ICDT’09]
Other RDM problems[Arasu et al. SIGMOD’11], [Binnig et al. ICDE’07], [Bohannon et al. PODS’06], [Fagin et al. JACM’10]
![Page 24: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/24.jpg)
Next Steps with Tiresias
TiresiasHandling non-partitionable problems
Approximations
Parallelization and handling of skew
Result analysis and feedback-based problem generation
![Page 25: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/25.jpg)
SIGMOD Demo Group CLocation: Vaquero A Time: 13:30-15:00
![Page 26: Tiresias](https://reader036.fdocuments.us/reader036/viewer/2022062410/56816455550346895dd621f2/html5/thumbnails/26.jpg)
Contributions How-To queries
Using MIP solvers to answer How-To queries
Tiresias prototype implementation
http://db.cs.washington.edu/tiresias