+ + + + Boris Glavic, Juliana Freire, Michael Brachmann, William Spoth, Poonam Kumari, Ying Yang, Su Feng, Heiko Mueller, Aaron Huber, and many more...
+Applied Computer Science
+
+ CREATE VIEW salesSinceLastMonth AS
+ SELECT l.*
+ FROM lineitem l, orders o
+ WHERE l.orderkey = o.orderkey
+ AND o.orderdate > DATE(NOW() - '1 Month')
+
+
+ SELECT partkey FROM salesSinceLastMonth
+ ORDER BY shipdate DESC LIMIT 10;
+
+
+ SELECT suppkey, COUNT(*)
+ FROM salesSinceLastMonth
+ GROUP BY suppkey;
+
+
+ SELECT partkey, COUNT(*)
+ FROM salesSinceLastMonth
+ GROUP BY partkey;
+
+ Opportunity: Views exist to be queried frequently
+Idea: Pre-compute and save the view’s contents!
+(like an index)
When the base data changes,
the view needs to be updated too!
Our view starts off initialized
+Idea: Recompute the view from scratch when data changes.
+$\Delta Q$ | +(ideally) Small & fast query | +
$+$ | +(ideally) Fast "merge" operation | +
+ + + + Boris Glavic, Juliana Freire, Michael Brachmann, William Spoth, Poonam Kumari, Ying Yang, Su Feng, Heiko Mueller, Aaron Huber, and many more...
+