The Power of How-to Queries
description
Transcript of The Power of How-to Queries
![Page 1: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/1.jpg)
The Power of How-to Queries
joint work with Dan Suciu (University of Washington)
Alexandra Meliou
![Page 2: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/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: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/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 changes.”
find changes to the source that achieve the desired effect
declare a desired effect in the target
reverse
![Page 4: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/4.jpg)
TPC-H example A manufacturing company keeps records of
inventory orders in a LineItem table. KPI: Cannot order more than 8% 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: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/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: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/6.jpg)
Demo: Tiresias
a tool that makes how-to queries practical
![Page 7: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/7.jpg)
Tiresias: How-To Query Engine
DBMS
MIPsolver
Tiresias
TiQL (Tiresias Query Language)
Declarative interface, extension to Datalog
![Page 8: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/8.jpg)
Overview
MathProgor AMPL
TiQL
Visualizations
![Page 9: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/9.jpg)
MathProg or AMPL
TiQL
Visualizations
Overview
Demo
![Page 10: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/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: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/11.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 12: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/12.jpg)
Evaluation of the Model Optimizer
baseline
with optimization
![Page 13: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/13.jpg)
Evaluation of Tiresias Partitioning
10k tuples 1M tuples
granularity of partitioning
complex dependency on the granularity of partitioning
![Page 14: The Power of How-to Queries](https://reader036.fdocuments.us/reader036/viewer/2022062410/568163d4550346895dd51fb5/html5/thumbnails/14.jpg)
Next steps Non-partitionable problems and approximations Soft constraints, diversification of results Interactive visualizations, feedback-based problem
generation Applications
Business intelligence, strategy planning View updates Data cleaning
Take-aways Databases should support how-to queries Data-driven optimizations could benefit the
performance of external tools