May 3, 2019
RSVP (limited space available) to participate
Lots of interesting strategies used in Checkpoint 3
(lambda-architecture edition)
Due May 20
No restarts.
No (although you can).
Ok... so what else can I do?
Problem 1: More indexes = Slower writes (bad for OLTP)
Problem 2: Fewer indexes = Slower reads (bad for OLAP)
What if you have both OLAP and OLTP workloads?
Idea: Weekly / Nightly / Hourly dump
from OLTP System to OLAP system.
(Index the data while dumping)
Problem: Not seeing the freshest data!
Better Idea: OLTP DB + OLAP DB.
OLTP DB has few indexes, but only stores recent updates.
OLAP DB has many indexes, and stores everything except recent updates.
Periodically migrate updates into OLAP DB.
(Lambda Architecture)
INSERT INTO FOO(A, B, C) VALUES (1, 2, 3);
SELECT COUNT(*) FROM lineitem WHERE mktsegment = 'BUILDING';
DELETE FROM FOO WHERE A > 5;
... but that's not quite how SQL Delete works.
DELETE FROM FOO WHERE A > 5;
DELETE FROM Orig WHERE Something;
INSERT INTO lineitem(...) VALUES (...);
INSERT INTO lineitem(...) VALUES (...);
DELETE FROM lineitem WHERE shipdate BETWEEN date(1997-10-01)
AND date(1997-10-30);
SELECT COUNT(*) FROM lineitem WHERE mktsegment = 'BUILDING';
UPDATE Foo SET A = 1, B = 2 WHERE C = 3;
UPDATE Foo SET A = 1, B = 2 WHERE C = 3;
UPDATE Foo SET A = 1, B = 2 WHERE C = 3;
SELECT CASE WHEN C = 3 THEN 1 ELSE A END AS A,
CASE WHEN C = 3 THEN 2 ELSE B END AS B,
C AS C
FROM Foo;