temporal databases: modifications
TRANSCRIPT
![Page 1: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/1.jpg)
Temporal Databases: Modification
Kristian Torp
Department of Computer ScienceAalborg University
people.cs.aau.dk/˜[email protected]
November 2, 2015
daisy.aau.dk
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 1 / 57
![Page 2: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/2.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 2 / 57
![Page 3: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/3.jpg)
Learning Goals
Learning GoalsUnderstand modifications on transaction-time tablesUnderstand modifications on valid-time tables
Implicit timestamping, system suppliedExplicit timestamping, user supplied
Understand modifications on bitemporal tablesImplicit timestamping, system suppliedExplicit timestamping, user supplied
now and UC in modifications
NoteWe will use integers for timestamps
simply because it takes up less space on slides
Will focus on state tablesMost expressiveHardest to understand (compared to event)
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 3 / 57
![Page 4: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/4.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 4 / 57
![Page 5: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/5.jpg)
Transaction-Time Example, Implicit Timestamping
NoteImplicit means timestamps values are always system supplied
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 5 / 57
![Page 6: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/6.jpg)
Transaction-Time Example, Implicit Timestamping
NoteImplicit means timestamps values are always system supplied
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 4: Transaction-Time Insert)
Name Dept tts tte
Ann HR 4 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 5 / 57
![Page 7: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/7.jpg)
Transaction-Time Example, Implicit Timestamping
NoteImplicit means timestamps values are always system supplied
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 8: Transaction-Time Update)
Name Dept tts tte
Ann HR 4 8Ann RD 8 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 5 / 57
![Page 8: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/8.jpg)
Transaction-Time Example, Implicit Timestamping
NoteImplicit means timestamps values are always system supplied
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 12: Transaction-Time Insert)
Name Dept tts tte
Ann HR 4 8Ann RD 8 UC
Bart HR 12 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 5 / 57
![Page 9: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/9.jpg)
Transaction-Time Example, Implicit Timestamping
NoteImplicit means timestamps values are always system supplied
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 16: Transaction-Time Delete)
Name Dept tts tte
Ann HR 4 8Ann RD 8 UC
Bart HR 12 16
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 5 / 57
![Page 10: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/10.jpg)
Transaction-Time Insert
Logical OperationsTime 4: Hire Ann to work in the HR department
Example (Emps as of Time 6)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ann, HR
Example (Table)
Name Dept tts tte
Ann HR 4 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 6 / 57
![Page 11: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/11.jpg)
Transaction-Time Update
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Example (Emps as of Time 10)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ann, RDAnn, HR
Example (Table)
Name Dept tts tte
Ann HR 4 8Ann RD 8 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 7 / 57
![Page 12: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/12.jpg)
Transaction-Time Insert (Again)Logical Operations
Time 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Example (Emps as of Time 14)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, RDAnn, RD
Ann, HR
Example (Table)
Name Dept tts tte
Ann HR 4 8Ann RD 8 UC
Bart HR 12 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 8 / 57
![Page 13: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/13.jpg)
Transaction-Time DeleteLogical Operations
Time 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire BartExample (Emps as of Time 18)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, RDAnn, RD
Ann, HR
Example (Table)
Name Dept tts tte
Ann HR 4 8Ann RD 8 UC
Bart HR 12 16Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 9 / 57
![Page 14: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/14.jpg)
Quiz: Transaction-Time State Table
Logical OperationsTime 4 Hire Curt to work in the HR department
Time 8 Move Curt to the RD department
Time 12 Fire Curt from the company
Name Dept tts tte
Curt HR 4 UC
Curt RD 8 UC
Name Dept tts tte
Curt HR 4 8Curt RD 8 UC
A B
Name Dept tts tte
Curt HR 4 8Curt RD 8 12
Name Dept tts tte
Curt HR 4 8Curt RD 8 12Curt RD 12 UC
C D
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 10 / 57
![Page 15: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/15.jpg)
Summary: Transaction-Time Modifications
Main PointsTransaction time always system supplied values
Insert: Explicit attributes + [current time, UC)
Delete: Set column tte to current time
Update: A delete followed by an insert
NoteSystem always supplies the timestamps!!!UC = Until Changed
Also called now or nobind-now
Queries on current state of table work as beforeBackwards compatibility⇒ no rewrite of existing code
Logical deletes (newer physical deletes)
More than one insert/update/delete per time unit
Physical database design split current from history
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 11 / 57
![Page 16: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/16.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 12 / 57
![Page 17: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/17.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 13 / 57
![Page 18: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/18.jpg)
Valid-Time Implicit Timestamping
NoteRecall, implicit means timestamps values are always system supplied
Logical Operationstime: 4 Hire Ann to work in the HR department
time: 8 Move Ann to the RD department
time: 12 Hire Bart to work in the HR department
time: 16 Fire Bart
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 14 / 57
![Page 19: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/19.jpg)
Valid-Time Implicit Timestamping
NoteRecall, implicit means timestamps values are always system supplied
Logical Operationstime: 4 Hire Ann to work in the HR department
time: 8 Move Ann to the RD department
time: 12 Hire Bart to work in the HR department
time: 16 Fire Bart
Example (At Time 4: Valid-Time Insert)
Name Dept vts vte
Ann HR 4 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 14 / 57
![Page 20: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/20.jpg)
Valid-Time Implicit Timestamping
NoteRecall, implicit means timestamps values are always system supplied
Logical Operationstime: 4 Hire Ann to work in the HR department
time: 8 Move Ann to the RD department
time: 12 Hire Bart to work in the HR department
time: 16 Fire Bart
Example (At Time 8: Valid-Time Update)
Name Dept vts vte
Ann HR 4 8Ann RD 8 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 14 / 57
![Page 21: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/21.jpg)
Valid-Time Implicit Timestamping
NoteRecall, implicit means timestamps values are always system supplied
Logical Operationstime: 4 Hire Ann to work in the HR department
time: 8 Move Ann to the RD department
time: 12 Hire Bart to work in the HR department
time: 16 Fire Bart
Example (At Time 12: Valid-Time Insert)
Name Dept vts vte
Ann HR 4 8Ann RD 8 now
Bart HR 12 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 14 / 57
![Page 22: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/22.jpg)
Valid-Time Implicit Timestamping
NoteRecall, implicit means timestamps values are always system supplied
Logical Operationstime: 4 Hire Ann to work in the HR department
time: 8 Move Ann to the RD department
time: 12 Hire Bart to work in the HR department
time: 16 Fire Bart
Example (At Time 16: Valid-Time Delete)
Name Dept vts vte
Ann HR 4 8Ann RD 8 now
Bart HR 12 16
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 14 / 57
![Page 23: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/23.jpg)
Valid-Time Insert
Logical OperationsTime 4: Hire Ann to work in the HR department
Example (Emps as of Time 6)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 4 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 15 / 57
![Page 24: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/24.jpg)
Valid-Time Update
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Example (Emps as of Time 10)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ann, RDAnn, HR
Example (Table)
Name Dept vts vte
Ann HR 4 8Ann RD 4 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 16 / 57
![Page 25: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/25.jpg)
Valid-Time Insert (Again)Logical Operations
Time 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Example (Emps as of Time 14)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, RDAnn, RD
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 4 8Ann RD 6 now
Bart HR 12 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 17 / 57
![Page 26: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/26.jpg)
Valid-Time DeleteLogical Operations
Time 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire BartExample (Emps as of Time 18)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, RDAnn, RD
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 4 8Ann RD 6 now
Bart HR 12 16Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 18 / 57
![Page 27: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/27.jpg)
Summary: Implicit Timestamping
Temporal ModificationsInsert: explicit attributes + [current time, now)
Delete: Set column vte to current time
Update: A delete followed by an insert
NoteImplicit valid-time and transaction-time is handled similarly
System can supplies the timestamps!!!
Operations on current state of table as before
Logical deletes (no physical deletes in these cases!!!)
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 19 / 57
![Page 28: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/28.jpg)
Quiz: Modifications to Table
Logical Operationstime:1 Hire Curt to work in the HR department
time:12 Fire Curt
time:20 Hire Dan to work in the HR department
Name Dept vts vte
Curt HR 1 12Dan HR 20 now
Name Dept vts vte
Curt HR 1 12Curt HR 12 now
Dan HR 20 now
A BName Dept vts vte
Curt HR 1 now
Curt HR 12 now
Dan HR 20 now
Name Dept vts vte
Curt HR 1 12Curt HR 12 20Dan HR 20 now
C D
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 20 / 57
![Page 29: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/29.jpg)
Quiz: Table to Modifications
Name Dept vts vte
Dan HR 1 now
Eli RD 10 20
ATime 1 Hire Dan, HR
Time 10 Hire Eli, RD
BTime 1 Hire Dan, HR
Time 10 Hire Eli, RD
Time 20 Fire Eli
CTime 1 Hire Dan, HR
Time 10 Hire Eli, RD
Time 10 Fire Dan
Time 20 Fire Eli
DTime 1 Hire Dan, HR
Time 10 Hire Eli, RD
Time 10 Eli to RD
Time 20 Fire EliKristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 21 / 57
![Page 30: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/30.jpg)
Quiz: Conceptual Difference?
Example (Departments)
Name Dept vts vte
Ann HR 1 10Ann RD 10 20Ann HR 20 40
Name Dept vts vte
Ann HR 1 15Ann RD 10 20Ann HR 20 40
Example (Salaries)
Name Salary vts vte
Ann 40 1 10Ann 50 10 20Ann 70 20 40
Name Salary vts vte
Ann 40 1 15Ann 50 10 20Ann 70 20 40
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 22 / 57
![Page 31: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/31.jpg)
Quiz: Conceptual Difference?
Example (Departments)
Name Dept vts vte
Ann HR 1 10Ann RD 10 20Ann HR 20 40
Name Dept vts vte
Ann HR 1 15Ann RD 10 20Ann HR 20 40
Example (Salaries)
Name Salary vts vte
Ann 40 1 10Ann 50 10 20Ann 70 20 40
Name Salary vts vte
Ann 40 1 15Ann 50 10 20Ann 70 20 40
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 22 / 57
![Page 32: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/32.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 23 / 57
![Page 33: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/33.jpg)
Valid-Time Example: Case One
NoteExlicit means timestamps values are user supplied
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Time 16: Move Bart to HR department
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 24 / 57
![Page 34: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/34.jpg)
Valid-Time Example: Case One
NoteExlicit means timestamps values are user supplied
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Time 16: Move Bart to HR department
Example (At Time 4: Valid-Time Insert)
Name Dept vts vte
Ann HR 2 14
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 24 / 57
![Page 35: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/35.jpg)
Valid-Time Example: Case One
NoteExlicit means timestamps values are user supplied
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Time 16: Move Bart to HR department
Example (At Time 8: Valid-Time Insert)
Name Dept vts vte
Ann HR 2 14Bart RD 14 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 24 / 57
![Page 36: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/36.jpg)
Valid-Time Example: Case One
NoteExlicit means timestamps values are user supplied
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Time 16: Move Bart to HR department
Example (At Time 12: Valid-Time Delete)
Name Dept vts vte
Ann HR 2 12Bart RD 14 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 24 / 57
![Page 37: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/37.jpg)
Valid-Time Example: Case One
NoteExlicit means timestamps values are user supplied
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Time 16: Move Bart to HR department
Example (At Time 16: Valid-Time Update)
Name Dept vts vte
Ann HR 2 12Bart RD 14 16Bart HR 16 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 24 / 57
![Page 38: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/38.jpg)
Valid-Time Insert
Logical OperationsTime:4 Hire Ann HR department [2, 14)
Example (Emps at Time 6)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 2 14
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 25 / 57
![Page 39: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/39.jpg)
Valid-Time Insert with now
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Example (Emps as of Time 10)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, RDAnn, HR
Example (Table)
Name Dept vts vte
Ann HR 2 14Bart RD 14 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 26 / 57
![Page 40: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/40.jpg)
Valid-Time Delete
Logical OperationsTime 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Example (Emps as of Time 15)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, RDAnn, HR
Example (Table)
Name Dept vts vte
Ann HR 2 12Bart RD 14 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 27 / 57
![Page 41: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/41.jpg)
Valid-Time UpdateLogical Operations
Time 4: Hire Ann HR department [2, 14)
Time 8: Hire Bart RD department [14, now)
Time 12: Fire Ann
Time 16: Move Bart to HR department
Example (Emps as of Time 18)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Bart, HRBart, RD
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 2 12Bart RD 14 16Bart HR 16 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 28 / 57
![Page 42: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/42.jpg)
Valid-Time Example: Case Two
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Time 16: Remove Bart from HR for the period [8, 20)
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 29 / 57
![Page 43: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/43.jpg)
Valid-Time Example: Case Two
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Time 16: Remove Bart from HR for the period [8, 20)
Example (At Time 4: Valid-Time Insert)
Name Dept vts vte
Ann HR 2 18
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 29 / 57
![Page 44: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/44.jpg)
Valid-Time Example: Case Two
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Time 16: Remove Bart from HR for the period [8, 20)
Example (At Time 8: Valid-Time Insert)
Name Dept vts vte
Ann HR 2 18Bart RD 14 24
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 29 / 57
![Page 45: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/45.jpg)
Valid-Time Example: Case Two
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Time 16: Remove Bart from HR for the period [8, 20)
Example (At Time 12: Valid-Time Update)
Name Dept vts vte
Ann HR 2 6Ann HR 14 18Bart RD 14 24
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 29 / 57
![Page 46: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/46.jpg)
Valid-Time Example: Case Two
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Time 16: Remove Bart from HR for the period [8, 20)
Example (At Time 16: Valid-Time Delete)
Name Dept vts vte
Ann HR 2 6Ann HR 14 18Bart RD 20 24
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 29 / 57
![Page 47: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/47.jpg)
Valid-Time Insert
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Example (Emps as of Time 6)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 2 18
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 30 / 57
![Page 48: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/48.jpg)
Valid-Time Insert (Again)
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Example (Emps as of Time 10)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Bart, RDAnn, HR
Example (Table)
Name Dept vts vte
Ann HR 2 18Bart RD 14 24
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 31 / 57
![Page 49: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/49.jpg)
Valid-Time Update
Logical OperationsTime 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Example (Emps as of Time 15)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Ann, HRBart, RD
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 2 6Ann HR 14 16Bart RD 14 24
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 32 / 57
![Page 50: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/50.jpg)
Valid-Time DeleteLogical Operations
Time 4: Hire Ann HR department [2, 18)
Time 8: Hire Bart RD Department [14, 24)
Time 12: Ann on leave [6, 14)
Time 16: Remove Bart from HR for the period [8, 20)
Example (Emps as of Time 18)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Ann, HRBart, RD
Ann, HR
Example (Table)
Name Dept vts vte
Ann HR 2 6Ann HR 14 16Bart RD 20 24
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 33 / 57
![Page 51: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/51.jpg)
Visualizations of DeleteExample (Result: Zero Rows)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDeleteResult
Example (Result: One Row)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDelete
Result
Example (Result: Two Rows)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDelete
Result Result
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 34 / 57
![Page 52: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/52.jpg)
Visualizations of DeleteExample (Result: Zero Rows)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDeleteResult
Example (Result: One Row)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDelete
Result
Example (Result: Two Rows)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDelete
Result Result
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 34 / 57
![Page 53: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/53.jpg)
Visualizations of DeleteExample (Result: Zero Rows)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDeleteResult
Example (Result: One Row)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDelete
Result
Example (Result: Two Rows)
VT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
DataDelete
Result Result
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 34 / 57
![Page 54: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/54.jpg)
Valid-Time State Modifications, Explicit Timestamping
OperationsInsert: Explicit attributes + interval suppliedDelete: Remove where delete interval overlaps (for each original row)
0 rows if delete interval totally overlaps1 row if delete interval left/right overlaps2 rows if delete interval contained in row interval
Update: Delete followed by insert
NoteUser supplies the timestamps
Physical deletes may occur
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 35 / 57
![Page 55: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/55.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 36 / 57
![Page 56: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/56.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 37 / 57
![Page 57: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/57.jpg)
Bitemporal Example, Implicit Timestamping
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 38 / 57
![Page 58: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/58.jpg)
Bitemporal Example, Implicit Timestamping
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 4: Bitemporal Insert)
Name Dept vts vte tts tte
Ann HR 4 now 4 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 38 / 57
![Page 59: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/59.jpg)
Bitemporal Example, Implicit Timestamping
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 8: Bitemporal Update)
Name Dept vts vte tts tte
Ann HR 4 now 4 8Ann HR 4 8 8 UC
Ann RD 8 now 8 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 38 / 57
![Page 60: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/60.jpg)
Bitemporal Example, Implicit Timestamping
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 12: : Bitemporal Insert)
Name Dept vts vte tts tte
Ann HR 4 now 4 8Ann HR 4 8 8 UC
Ann RD 8 now 8 UC
Bart HR 12 now 12 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 38 / 57
![Page 61: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/61.jpg)
Bitemporal Example, Implicit Timestamping
Logical OperationsTime 4: Hire Ann to work in the HR department
Time 8: Move Ann to the RD department
Time 12: Hire Bart to work in the HR department
Time 16: Fire Bart
Example (At Time 16: : Bitemporal Delete)
Name Dept vts vte tts tte
Ann HR 4 now 4 8Ann HR 4 8 8 UC
Ann RD 8 now 8 UC
Bart HR 12 now 12 16Bart HR 12 16 16 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 38 / 57
![Page 62: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/62.jpg)
Bitemporal Graphs
Example (Ann)
TT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
VT
0123456789
101112131415161718
Ann, HR Ann, HR
Ann, RD
Example (Bart)
TT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
VT
0123456789
101112131415161718
Bart, HRBart, HR
NoteVisualized in two graphs, because data ”overlap”
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 39 / 57
![Page 63: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/63.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 40 / 57
![Page 64: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/64.jpg)
Bitemporal Delete, Explicit Valid Time
Example (Case 1: No changes)time:1 Insert Ann, HR, [2, 8)
Example (Case 2: Delete entire interval)time:1 Insert Ann, HR, [2, 8)
time:5 Delete Ann, HR, [1, 10)
Example (Case 3: Delete first part)time:1 Insert Ann, HR, [2, 8)
time:5 Delete Ann, HR, [1, 5)
Example (Case 4: Delete in the middle)time:1 Insert Ann, HR, [2, 8)
time:5 Delete Ann, HR, [4, 7)
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 41 / 57
![Page 65: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/65.jpg)
Bitemporal Delete, Explicit Valid Time, Case 1, Time 10
Example (Case 1: No changes)time:1 Insert Ann, HR, [2, 8)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 42 / 57
![Page 66: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/66.jpg)
Bitemporal Delete, Explicit Valid Time, Case 2, Time 10
Example (Case 2: Delete entire interval)time:1 Insert Ann, HR, [2, 8)
time:5 Delete Ann, HR, [1, 10)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 5
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 43 / 57
![Page 67: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/67.jpg)
Bitemporal Delete, Explicit Valid Time, Case 3, Time 10
Example (Case 3: Delete first part)time:1 Insert Ann, HR, [2, 8)
time:5 Delete Ann, HR, [1, 5)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HRAnn, HR
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 5Ann HR 5 8 5 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 44 / 57
![Page 68: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/68.jpg)
Bitemporal Delete, Explicit Valid Time, Case 4, Time 10
Example (Case 4: Delete in the middle)time:1 Insert Ann, HR, [2, 8)
time:5 Delete Ann, HR, [4, 7)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Ann, HR
Ann, HR
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 5Ann HR 2 4 5 UC
Ann HR 7 8 5 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 45 / 57
![Page 69: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/69.jpg)
Bitemporal Delete Explicit Valid-Time, Summary, Time 10
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HRAnn, HR
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Ann, HR
Ann, HR
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 46 / 57
![Page 70: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/70.jpg)
Bitemporal Update Explicit Valid-Time
Example (Case 1: No changes)time:1 Insert Ann, HR, [2, 8)
Example (Case 2: Update entire interval)time:1 Insert Ann, HR, [2, 8)
time:5 Update Ann, RD, [1, 10)
Example (Case 3: Update first part)time:1 Insert Ann, HR, [2, 8)
time:5 Update Ann, RD, [1, 5)
Example (Case 4: Update in the middle)time:1 Insert Ann, HR, [2, 8)
time:5 Update Ann, RD, [4, 7)
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 47 / 57
![Page 71: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/71.jpg)
Bitemporal Update Explicit Valid-Time, Case 1, Time 10
Example (Case 1: No changes)time:1 Insert Ann, HR, [2, 8)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 now
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 48 / 57
![Page 72: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/72.jpg)
Bitemporal Update Explicit Valid-Time, Case 2, Time 10
Example (Case 2: Update entire)time:1 Insert Ann, HR, [2, 8)
time:5 Update Ann, RD, [1, 10)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HRAnn, RD
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 5Ann RD 1 10 5 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 49 / 57
![Page 73: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/73.jpg)
Bitemporal Update Explicit Valid-Time, Case 3, Time 10
Example (Case 3: Update first part)time:1 Insert Ann, HR, [2, 8)
time:5 Update Ann, RD, [1, 5)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HRAnn, HR
Ann, RD
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 5Ann HR 5 8 5 UC
Ann RD 1 5 5 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 50 / 57
![Page 74: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/74.jpg)
Bitemporal Update Explicit Valid-Time, Case 4, Time 10
Example (Case 4: Update in the middle)time:1 Insert Ann, HR, [2, 8)
time:5 Update Ann, RD, [4, 7)
Example (Graph)
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Ann, HR
Ann, HR
Ann, RD
Example (Table)
Name Dept vts vte tts tte
Ann HR 2 8 1 5Ann HR 2 4 5 UC
Ann HR 7 8 5 UC
Ann RD 4 7 5 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 51 / 57
![Page 75: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/75.jpg)
Bitemporal Graphs: Explicit Valid-Time at Time 10
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HRAnn, RD
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HRAnn, HR
Ann, RD
TT0 1 2 3 4 5 6 7 8 9 10
VT
0123456789
10
Ann, HR
Ann, HR
Ann, HR
Ann, RD
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 52 / 57
![Page 76: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/76.jpg)
Assignment: Bitemporal Modification I
Modifications on (Name, Salary)Time:2 insert Joe, 10
Time:4 insert Tom, 22
Time:10 Update Joe’s salary to 15
Time:12 Delete Tom
AssignmentsShow the content of the table emp bt at time 15
Draw the bitemporal graph for the table emp bt
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 53 / 57
![Page 77: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/77.jpg)
Assignment: Bitemporal Modification II
Name Salary vts vte tts tte
Joe 10 2 now 2 10Tom 22 4 now 4 12Joe 10 2 10 10 UC
Joe 15 10 now 10 UC
Tom 22 4 12 4 UC
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 54 / 57
![Page 78: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/78.jpg)
Assignment: Bitemporal Modification III
TT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
VT
0123456789
101112131415
Joe, 10 Joe, 10
Joe, 15
TT0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
VT
0123456789
101112131415
Tom, 22 Tom, 22
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 55 / 57
![Page 79: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/79.jpg)
Outline
1 Transaction-Time State Tables
2 Valid-Time State TablesImplicit TimestampingExplicit Timestamping
3 Bitemporal State TablesImplicit TimestampingExplicit Timestaming
4 Summary
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 56 / 57
![Page 80: Temporal Databases: Modifications](https://reader030.vdocuments.mx/reader030/viewer/2022021500/58f12ee11a28ab725a8b4691/html5/thumbnails/80.jpg)
Summary
Main PointsImplicit timestamps valid-time ≈ transaction-timeExplicit timestamp for valid-time many details
Insert, fairly straight-forwardDelete, complicated because 0, 1, or 2 intervalsUpdate, is conceptual still a delete followed by an insert!
Many details for bitemporal with explicit timestampingAgain delete the hardest to understandUpdate, is conceptual still a delete followed by an insert!
NoteUse half-open intervals, e.g., [10, 15) makes life simpler!
Kristian Torp (Aalborg University) Temporal Databases: Modification November 2, 2015 57 / 57