Logical Data Expiration David Toman School of Computer Science - - PowerPoint PPT Presentation

logical data expiration
SMART_READER_LITE
LIVE PREVIEW

Logical Data Expiration David Toman School of Computer Science - - PowerPoint PPT Presentation

Logical Data Expiration David Toman School of Computer Science List of Slides 27 Space Utilization 28 Adding Fixpoints 29 Example 2 Data Evolution and Histories 30 Metric Temporal Logic 3 Data Access and Queries 31 Future Temporal


slide-1
SLIDE 1

Logical Data Expiration

David Toman

School of Computer Science

slide-2
SLIDE 2

List of Slides

2 Data Evolution and Histories 3 Data Access and Queries 4 Expiration 5 Examples 6 Outline of the Talk 7 Temporal Databases and Histories 8 Example 9 Temporal Queries 10 Example 11 Finite vs. Infinite Histories 12 Expiration Operator 13 Examples 14 More Examples 15 Expiration vs. Queries Revisited 16 How Good is an Expiration Operator? 17 Example 18 Finite Histories 19 Administrative Approaches 20 Vacuuming 21 Query Driven Expiration 22 Query Driven Approaches 23 Past Temporal Logic 24 Unfolding and Materialized Views 25 Example 26 Example (cont.) 27 Space Utilization 28 Adding Fixpoints 29 Example 30 Metric Temporal Logic 31 Future Temporal Logic 32 Biquantified Formulas 33 Two-sorted First-order Language 34 Expiration Revisited 35 Handling History Extensions 36 Query Specialization 37 Example 38 Duplicate Information Removal 39 Equivalence in Extensions 40 Example 41 Residual History Reconstruction 42 Example 43 Properties of the Expiration Operator 44 Space: Lower Bound 45 Limits of Bounded Encoding 46 Counting 47 Duplicates 48 Retroactive Updates 49 Infinite Histories 50 Infinite Histories (cont.) 51 Related Issues 52 Open Problems 53 Acknowledgment

slide-3
SLIDE 3

2

Data Evolution and Histories

Changes of data can be captured (conceptually) by histories:

  • ✁✄✂
☎ ✂
  • ✁✄✆
☎ ✆
  • ✁✄✝
☎ ✝ ✞ ✞ ✞
  • ✁✠✟☛✡
  • ✁✠✟
☎ ✟ ✞ ✞ ✞ ☞ ✌

states

✍✏✎

describe system state

transitions

✍ ✎ ✑ ✍ ✎ ✒ ✓

represent system evolution

append only histories (new states appear at the end)

David Toman

slide-4
SLIDE 4

3

Data Access and Queries

Data is accessed using queries

simple value look-ups vs. complex query languages

current state only vs. access to past states

analysis of data warehouse evolution

enforcement of dynamic/temporal integrity constraints

monitoring applications

David Toman

slide-5
SLIDE 5

4

Expiration

  • 1. Policy-driven expiration
  • 2. Query-driven (logical) expiration

The data to be removed (expired) is determined by the (class of) queries we are allowed to ask in all possible extensions of a history

David Toman

slide-6
SLIDE 6

5

Examples

Record keeping/business rules:

tax forms must be kept 5 years back

Dynamic integrity constraints:

don’t hire anyone you’ve fired in the past

Caching policies

what data should be moved to backup storage?

Moving window queries, etc. . .

David Toman

slide-7
SLIDE 7

6

Outline of the Talk

Temporal Database Primer

Expiration Operators

How good is an expiration operator?

Administrative Approaches to Expiration

Query-driven Expiration

Temporal Logic and Materialized Views

First-order Queries and Partial Evaluation

Space Limits for Expiration Operators

Infinite Extensions of Histories and Potential Answers

David Toman

slide-8
SLIDE 8

7

Temporal Databases and Histories

System states: Relational structures (fixed schema) Time: discrete (integer-like)

✕ ✖✘✗ ✙ ✙ ✙ ✗ ✚ ✗ ✙ ✙ ✙ ✛
  • 1. Snapshot Temporal Database:

time-indexed sequence of relational structures

History, Kripke structure

  • 2. Timestamp Temporal Database:

time-indexed tuples (i.e., additional temporal attribute)

append-only:

✜✣✢ ✤✦✥ ✒ ✓

Choices 1 and 2 equivalent [Chomicki and Toman, 1998]

David Toman

slide-9
SLIDE 9

8

Example

Information about TA and courses by semester:

✖ ✕✧ ★ ✩ ✪✬✫ ✗ ✭✮ ✯ ✯ ✰ ✱ ✛ ✲ ✕✧ ★ ✩ ✪✬✫ ✗ ✭✮ ✯ ✯ ✰ ✱ ✗ ✧ ✮✴✳ ✵ ✗ ✭✮ ✶ ✷ ✯ ✱ ✛ ✶ ✕✧ ★ ✩ ✪✬✫ ✗ ✭✮ ✯ ✯ ✰ ✱ ✛ ✷ ✕✧ ✮✴✳ ✵ ✗ ✭ ✮ ✶ ✷ ✯ ✱ ✛

David Toman

slide-10
SLIDE 10

9

Temporal Queries

Queries: first-order formulas (over a fixed schema)

  • 1. Temporal logic (FOTL)

modal (temporal) connectives

implicit references to time

  • 2. Temporal Relational Calculus (2-FOL):

temporal variables/attributes/quantifiers

explicit access to time and ordering of time Proposition 1 ([Abiteboul et al., 1996, Toman and Niwinski, 1996 FOTL cannot express all 2-FOL queries.

David Toman

slide-11
SLIDE 11

10

Example

Students who TA’ed at least one class twice:

in (past) FOTL:

✕✹✸ ✺ ✻ ✧ ✼ ✽ ✙ ✾ ✿ ✧ ✸ ✗ ✽ ✱❁❀ ❂ ✻ ✾ ✿ ✧ ✸ ✗ ✽ ✱ ✱ ✛ ✌

in 2-FOL:

✕✹✸ ✺ ✼ ❃ ✓ ✗ ❃❅❄ ✙ ❃ ✓ ❆ ❃❅❄ ❀ ✼ ✽ ✙ ✾ ✿ ✧ ❃ ✓ ✗ ✸ ✗ ✽ ✱❁❀ ✾ ✿ ✧ ❃ ❄ ✗ ✸ ✗ ✽ ✱ ✛

David Toman

slide-12
SLIDE 12

11

Finite vs. Infinite Histories

Semantics of queries defined w.r.t:

  • 1. current (finite) history

query evaluation on a finite temporal database

  • 2. a completion of current history

hypothetical reasoning

David Toman

slide-13
SLIDE 13

12

Expiration Operator

provides an inductive definition

❇ ✧❈ ❉ ✱ ❊ ✖ ❋

(initial state)

❇ ✧ ✜ ✢ ✤ ✱ ❊
✧ ❇ ✧ ✜ ✱ ✗ ✤ ✱

(extension maintenance) for an induced operator on histories, and

maintains the following invariant:

❍ ✧ ✜ ✱ ❊ ❍ ❋ ✧ ❇ ✧ ✜ ✱ ✱

(answer preservation)

David Toman

slide-14
SLIDE 14

13

Examples

the identity operator:

✖ ❋✴■ ❏ ❊ ❈ ❉
  • ❋❑■
❏ ❊ ▲ ✜ ▲ ✍ ✙ ✜✣✢ ✍ ❍ ❋ ■ ❏ ❊ ❍ ✌

the current operator:

✖ ❋◆▼ ❖ P ❊ ❈ ❉
  • ❋◗▼
❖ P ❊ ▲ ✜ ▲ ✍ ✙ ❈ ✍ ❉ ❍ ❋ ▼ ❖ P ❊ ❍

Note that the supported query languages are different. . .

David Toman

slide-15
SLIDE 15

14

More Examples

compression based operator:

✖ ❋✏❘ ❖ ❙❚❯ ❱❲ ❲ ❊ ❳ ✩ ❨ ❩❬ ✵❭ ❭ ✧ ❈ ❉ ✱
  • ❋❪❘
❖ ❙❚❯ ❱❲ ❲ ❊ ▲ ✜ ▲ ✍ ✙ ❳ ✩ ❨ ❩❬ ✵❭ ❭ ✧ ❫ ✵ ❳ ✩ ❨ ❩❬ ✵ ❭ ❭ ✧ ✜ ✱ ✢ ✍ ✱ ❍ ❋❪❘ ❖ ❙❚❯ ❱❲ ❲ ❊ ▲ ✜ ✙ ❍ ✧ ❫ ✵ ❳ ✩ ❨ ❩❬ ✵❭ ❭ ✧ ✜ ✱ ✱ ✔ ❳ ✩ ❨ ❩❬ ✵ ❭ ❭

and

❫ ✵ ❳ ✩ ❨ ❩❬ ✵❭ ❭

are lossless.

accounts for interval encoding of temporal databases.

David Toman

slide-16
SLIDE 16

15

Expiration vs. Queries Revisited

  • 1. Given an expiration operator

for what class of queries it preserves answers?

can these be characterized syntactically?

  • 2. Given a fixed set of temporal queries:

is there an expiration operator that maintains answers to these queries?

that minimizes

❴ ❇ ✧ ✜ ✱ ❴

?

can it be found algorithmically?

what query language can we formulate the queries?

David Toman

slide-17
SLIDE 17

16

How Good is an Expiration Operator?

What is the space needed by

❇ ✧ ✜ ✱

in terms of

  • 1. size of the original history,
❴ ✜ ❴

,

  • 2. length of

(number of states,

❴ ❵ ❛ ❜ ❝ ❴

),

  • 3. the size of the active data domain of

(number of constants that have appeared in

,

❴ ❵ ❛ ❜ ❞ ❴

),

  • 4. size of the queries.

Goal: make the size of

❇ ✧ ✜ ✱

independent of length of

.

bounded expiration operator

David Toman

slide-18
SLIDE 18

17

Example

Proposition 2

❇❢❡ ❣ ❤

is bounded. Proposition 3 Let

❳ ✩ ❨ ❩❬ ✵❭ ❭

and

❫ ✵ ❳ ✩ ❨ ❩❬ ✵ ❭ ❭

define lossless compression scheme. Then

❇❥✐ ❣ ❦❧ ♠ ♥♦ ♦

cannot be bounded. . . . how about

❇q♣

for a temporal query

?

David Toman

slide-19
SLIDE 19

18

Finite Histories

Query answers defined with respect to a finite history

❈ ✤✦r ✗ ✤ ✓ ✗ ✙ ✙ ✙ ✗ ✤ts ❉ ✔

active domain semantics.

David Toman

slide-20
SLIDE 20

19

Administrative Approaches

query-independent expiration policies.

characterize queries whose answers are not affected, or

detect attempts to access the missing data at run-time. Most common approach: history truncation or cutoff point

  • 1. policies based on fixed absolute cutoff point, or
  • 2. policies based on now-relative cutoff point.

A generalization of the

❇ ✉ ✈

and the

❇ ❡ ❣ ❤
  • perators

David Toman

slide-21
SLIDE 21

20

Vacuuming

[Jensen, 1995]:

✌ ✇ ✧ ① ✱ ✺ ②

(a remove specification), and

✌ ③ ✧ ① ✱ ✺ ②

(a keep specification).

is a temporal relation;

a selection condition

a special constant symbol now

David Toman

slide-22
SLIDE 22

21

Query Driven Expiration

Proposition 4 Finite relational structures can be completely characterized by first-order queries. GOAL: an expiration operator for a fixed query

.

query language for

?

Past FOTL (and variants)

Future FOTL

2-FOL Proposition 5 Optimal expiration operator is not possible.

we try for a bounded expiration operator.

David Toman

slide-23
SLIDE 23

22

Query Driven Approaches

  • 1. Removal of “old” states (expiration)

removes a subset of existing states

no other changes (maps a history to another history)

  • 2. Auxiliary (non-temporal) view maintenance

maintains auxiliary relations

maps a history to a single extended state

  • 3. Specialization of queries

specializes a given query w.r.t. the known prefix

.

David Toman

slide-24
SLIDE 24

23

Past Temporal Logic

Syntax: First-order logic past temporal operators

❍ ✺ ✺ ❊ ① ✧⑤④ ✱ ❴ ⑥ ❴ ❍ ❀ ❍ ❴⑧⑦ ❍ ❴ ✼ ✸ ✙ ❍ ❴ ❂ ❍ ❴ ❍⑩⑨ ❶✣❷ ❸❹ ❍ ✔

queries over unbounded past:

✕✹✸ ✺ ✻ ① ✧ ✸ ✱ ✛ ✌

Semantics:

❍ ✧ ✜ ✱ ❊ ✕ ❺ ✺ ✜ ✗ ❺ ✗ ❻ ❴ ❊ ❍ ✛

where

is the last time instant in

.

David Toman

slide-25
SLIDE 25

24

Unfolding and Materialized Views

Crux of the approach:

❍ ✓ ⑨ ❶✣❷ ❸❹ ❍ ❄ ❼ ❍ ✓ ❀ ✧ ❂ ❍ ❄ ❽ ❂ ✧ ❍ ✓ ⑨ ❶✣❷ ❸ ❹ ❍ ❄ ✱ ✱ ✔

make an auxiliary view for each temporal subformula

use recurrent definitions of PastTL connectives to maintain the views.

❾ ① r ❿ ① s ❿ ❂ ❍ ➀❑➁ ➂ ❭ ✵ ❍ s➄➃ ✓ ❍ ✓ ⑨ ❶✣❷ ❸❹ ❍ ❄ ➀❑➁ ➂ ❭ ✵ ❍ s ✓ ❀ ✧ ❍ s ➃ ✓ ❄ ❽ ① s ➃ ✓ ❿ ✱

David Toman

slide-26
SLIDE 26

25

Example

Query: Students who have TA’ed at least one class twice.

✕✹✸ ✺ ✻ ✧ ✼ ✽ ✙ ✾ ✿ ✧ ✸ ✗ ✽ ✱❁❀ ❂ ✻ ✾ ✿ ✧ ✸ ✗ ✽ ✱ ✱ ✛ ✌

Temporal subqueries:

❾ ✓ ❊ ✻ ✾ ✿ ✧ ✸ ✗ ✽ ✱

and

❾ ❄ ❊ ❂ ✻ ✾ ✿ ✧ ✸ ✗ ✽ ✱

and

❾ ➅ ❊ ✻ ✼ ✽ ✙ ✾ ✿ ✧ ✸ ✗ ✽ ✱ ❀ ✻ ✾ ✿ ✧ ✸ ✗ ✽ ✱

.

David Toman

slide-27
SLIDE 27

26

Example (cont.)

inductive maintenance of views:

➆➈➇ ➉ ➊➌➋✹➍ ➎ ➏ ➐ ➊ ➑➓➒ ➔➣→ ➍ ↔↕ ➙ ➙ ➛ ➏➜ ➐ ➊ ➑ ➒ ➔ → ➍ ↔↕ ➙ ➙ ➛ ➏ ➍ ➊ ↕➞➝ ➟ ➍ ↔ ↕ ➠ ➡ ➙ ➏ ➜ ➐ ➊ ➑ ➒ ➔ → ➍ ↔↕ ➙ ➙ ➛ ➏ ➍ ➊ ↕➞➝ ➟ ➍ ↔ ↕ ➠ ➡ ➙ ➏ ➜ ➐ ➊ ➑ ➒ ➔ → ➍ ↔↕ ➙ ➙ ➛ ➏ ➍ ➊ ↕➞➝ ➟ ➍ ↔ ↕ ➠ ➡ ➙ ➏ ➜ ➆➈➇ ➢ ➊ ➋ ➍ ➎ ➏ ➐ ➜ ➐ ➊ ➑ ➒ ➔ → ➍ ↔ ↕ ➙ ➙ ➛ ➏ ➜ ➐ ➊ ➑➓➒ ➔ → ➍ ↔↕ ➙ ➙ ➛ ➏ ➍ ➊ ↕➞➝ ➟ ➍ ↔↕ ➠ ➡ ➙ ➏➜ ➐ ➊ ➑➓➒ ➔ → ➍ ↔↕ ➙ ➙ ➛ ➏ ➍ ➊ ↕➞➝ ➟ ➍ ↔↕ ➠ ➡ ➙ ➏➜ ➆➈➇ ➤ ➊➌➋ ➐ ➜ ➐ ➑ ➒ ➔ → ➐ ➑ ➒ ➔ → ➐ ➑➓➒ ➔ → ➍ ↕

David Toman

slide-28
SLIDE 28

27

Space Utilization

✌ ❍ ❊ ✻ ✧✹➥ ✧ ✸ ✓ ✱❁❀ ✙ ✙ ✙ ❀ ➥ ✧ ✸ ➦ ✱ ✱ ✌ ✜ ❊ ❈ ✕✹➧ ✓ ✛ ✗ ✕ ➧ ❄ ✛ ✗ ✕ ➧ ➅ ✛ ✗ ✙ ✙ ✙ ✗ ✕ ➧ s ✛ ❉ ✙

For

❾ ❊ ✻ ✧ ➥ ✧ ✸ ✓ ✱ ❀ ✙ ✙ ✙ ❀ ➥ ✧ ✸ ➦ ✱ ✱

:

❴ ① ❿ ❴ ❊ ✧ ❻➩➨ ✲ ✱ ➦

. . . the same holds for every prefix of

. Full details: [Chomicki, 1995], subsumes approaches based

  • n TRA [Yang and Widom, 1998, Yang and Widom, 2000].

David Toman

slide-29
SLIDE 29

28

Adding Fixpoints

Syntax:

❍ ✺ ✺ ❊ ① ✧⑤④ ✱ ❴ ⑥ ❴ ❍ ❀ ❍ ❴ ⑦ ❍ ❴ ✼ ✸ ✙ ❍ ❴ ❂ ❍ ❴✹➫ ➭ ✙ ❍ ✙ ✌

Unfolding of fixpoint:

➫ ➭ ✙ ❍ ❼ ❍ ✧ ➫ ➭ ✙ ❍ ✱ ✌

Inductive maintenance of auxiliary relation:

❾ ① r ❿ ① s➯❿ ❂ ❍ ➀❑➁ ➂✣❭ ✵ ❍ s ➃ ✓ ➫ ➭ ✙ ❍ ❍ r ❍ s

David Toman

slide-30
SLIDE 30

29

Example

Query: students who TA’ed in “even” terms

➫ ➭ ✙ ✼ ✽ ✙ ✾ ✿ ✧ ✸ ✗ ✽ ✱ ❽ ❂ ❂ ➭ ✌

Temporal subformulas:

❾ ✓ ❊ ➫ ➭ ✙ ✼ ✽ ✙ ✾ ✿ ✧ ✸ ✗ ✽ ✱ ❽ ❂ ❂ ➭

,

❾ ❄ ❊ ❂ ❂ ➭

, and

❾ ➅ ❊ ❂ ➭

.

① ❿ ✆ ✧ ✸ ✱ ① ❿ ✝ ✧ ✸ ✱ ① ❿ ➲ ✧ ✸ ✱ ✖ ✕ ★ ✩ ✪✬✫ ✛ ✕ ✛ ✕ ✛ ✲ ✕ ★ ✩ ✪✬✫ ✗ ✮✴✳ ✵ ✛ ✕ ✛ ✕ ★ ✩ ✪✬✫ ✛ ✶ ✕ ★ ✩ ✪✬✫ ✛ ✕ ★ ✩ ✪✬✫ ✛ ✕ ★ ✩ ✪✬✫ ✗ ✮✴✳ ✵ ✛ ✷ ✕ ★ ✩ ✪✬✫ ✗ ✮✴✳ ✵ ✛ ✕ ★ ✩ ✪✬✫ ✗ ✮✴✳ ✵ ✛ ✕ ★ ✩ ✪✬✫ ✛

David Toman

slide-31
SLIDE 31

30

Metric Temporal Logic

access to real time time instants

a

❳ ➂➳

constant in each state (current real time)

not part of the active data domain

additional temporal operators

❍ ✺ ✺ ❊ ✙ ✙ ✙ ❴ ⑨ ❶✣❷ ❸ ❹➸➵ ➺ ❴ ❂ ➵ ➺ ✔

semantics respects

➻ ➼

distances

materialized views now contain distance values

bounded by

➼ ✔

bounded expiration if

❳ ➂➳ ✎ ➨ ❳ ➂ ➳ ✎ ➃ ✓❑➽ ➾ ➚ ✖

David Toman

slide-32
SLIDE 32

31

Future Temporal Logic

Syntax:

❍ ✺ ✺ ❊ ① ✧ ④ ✱ ❴ ⑥ ❴ ❍ ❀ ❍ ❴⑧⑦ ❍ ❴ ✼ ✸ ✙ ❍ ❴➶➪ ❍ ❴ ❍✬➹ ❷ ➘ ❶ ➴ ❍ ✌

Semantics:

❍ ✧ ✜ ✱ ❊ ✕ ❺ ✺ ✜ ✗ ❺ ✗ ✖ ❴ ❊ ❍ ✛

where

is the first time instant in

.

but still active domain semantics

Unfolding rule (similarly to PastTL):

❍ ✓ ➹ ❷ ➘ ❶ ➴ ❍ ❄ ❼ ❍ ✓ ❀ ✧ ➪ ❍ ❄ ❽ ➪ ✧ ❍ ✓ ➹ ❷ ➘ ❶ ➴ ❍ ❄ ✱ ✱ ✔

but now we need to represent a formula with holes to be substituted when the history is extended.

David Toman

slide-33
SLIDE 33

32

Biquantified Formulas

Automata-based approach

designed in the propositional setting

interleaving quantifiers and temporal connectives?

[Lipeck and Saake, 1987, Lipeck et al., 1994]

restrictions to Future FOTL syntax: 3 layers

  • 1. FO formulas (evaluated in a state,
  • 2. TL(FO) formulas (temporal operators on top of (1),
  • 3. Universal quantifiers on top of (2)

bounded expiration based on an automaton for (2) implemented by triggers.

David Toman

slide-34
SLIDE 34

33

Two-sorted First-order Language

Temporal Relational Calculus (2-FOL)

➷ ✺ ✺ ❊ ① ✧ ❃ ✗ ④ ✱ ❴ ✸ ❊ ✸ ➬ ❴ ❃ ❆ ❃ ➬ ❴ ❃ ❊ ❃ ➬ ❴ ➷ ❀ ➷ ❴ ➷ ❀ ⑦ ➷ ❴ ➷ ❽ ➷ ❴ ✼ ✸ ✙ ➷ ❴ ✼ ❃ ✙ ➷

where

① ✧ ❃ ✗ ④ ✱

is true in

iff

① ✧ ④ ✱

is true in

✤ ✁

Does a bounded expiration operator exist for 2-FOL?

conjectured that it does NOT exist NOTE: 2-FOL queries with unbounded answers cannot have bounded expiration operator

consider only bounded queries

David Toman

slide-35
SLIDE 35

34

Expiration Revisited

Idea: remove those states that

  • 1. do not contribute to query answer (due to

)

  • 2. contribute duplicate information (due to

) Easy for a fixed history:

compute answer to

bottom-up

propagate “back” to remove redundant data

David Toman

slide-36
SLIDE 36

35

Handling History Extensions

Atomic formulas:

✌ ➮ ➱➯✃ ❐ ❼ ❒ ❮ ❰ ✸ ❊ ➧ ➧ Ï ❵ ❛ ❜ ❞ Ð ➧ Ï ❵ ❛ ❜ ❞ ✙ ✸ Ñ ❊ ➧ ➧ ❊ ✌ ✌ ➮ ✁ Ò ❐ ❼ ❒ ❮ ❰ ❃ ❊ Ó Ó Ï ❵ ❛ ❜ ❝ ❃ ➚

maxtime

✧ ❵ ❛ ❜ ❝ ✱ Ó ❊ ✌

Specialization of base relations and their extensions:

① ✧ ❃ ✗ ④ ✱ ❼ Ô Õ ÖØ×ÚÙ

true

➮ ✁ÜÛ Ò Ô ❐ ❽ Ô Õ ÝßÞ à × á âäã å ① ✧ ❃ ✗ ④ ✱ ➮ ✁ Û ã Ô ❐ ✔

disjoint union

depends only on the future extensions

David Toman

slide-37
SLIDE 37

36

Query Specialization

æç✬è é ♣ ê✴ë ❒ ìíìîì➌ìíìîì➌ìíìîìîìîìîìîìîìîìîìîìîìîìîìîìîìîìîìîìîìî❮ ìîìîìîìîìîìîìîìîìîìîìîìíì➌ìîìíì➌ìîìíì➌ìîìíì➌ìîìíì➌ìî❰ â

true

ï ð ñ Ù ò óÚô Ö é Ò➣õ Ô ê Õ ❞ å á â Ö é ✁ õ Û ê ï ð ñ÷ö ò ó ô Ô Õ é ÝßÞ à × á âäã å ê ø ñ ø å ♣ ù Ö é ✁ õ Û ê â ♣ ú ✆ ï ñ ò ó ô ♣ ú ✆ ï ñ ò ó Õ æ ç✬è é ♣ ✆ ê õ û ë ï ñ ò ó ü ý å ♣ ù ♣ ✆ ü ý â ♣ ú ✆ ü ♣ ú ✝ ï ñþ ò ÿ óÚô ♣ ú ✆ ï ñ ò ó Õ æç è é ♣ ✆ ê õ ♣ ú ✝ ï þ ÿ ó Õ æç✣è é ♣ ✝ ê õ û ë ï ñþ ò ÿ ó å ♣ ù ♣ ✆ ü ♣ ✝ â é
  • ✁✄✂
☎✝✆ ✞ ➉ ✟ ✠✡☞☛ ✌ ✍ ✎ ✏✑ ✒ ✓ ✆ ➉ ✔ ♣ ú ✆ ê ï ñ ò ó ô ✕ ✂ ♣ ú ú ✆ ï ñ ✖ ò ✗ ó Õ æç è é ♣ ✆ ê å ♣ ù
  • ✁✄✂
♣ ✆ â é
✂ ☎ ✆ ✞ ➉ ✟ ✠ ✘ ☛ ✙ ✍ ✎ ✏✑ ✒ ✓ ✆ ➉ ✔ ♣ ú ✆ ê ï ñ ò ó ô
  • Ò
✂ ♣ ú ú ✆ ï ñ ð ò Ù ó Õ æ ç✣è é ♣ ✆ ê å ♣ ù
✂ ♣ ✆ â ♣ ú ✆ ü ✚ ♣ ú ✝ ï ñ ò óÚô ♣ ú ✆ ï ñ ò ó Õ æç è é ♣ ✆ ê õ ♣ ú ✝ ï ñ ò ó Õ æ ç✣è é ♣ ✝ ê å á â ♣ ú ✆ ï ñ ò ó ô ♣ ú ✆ ï ñ ò ó Õ æç✬è é ♣ ✆ ê õ ♣ ú ✝ ï ñ ò ó ✛ Õ æç è é ♣ ✝ ê å ♣ ù ♣ ✆ ü ✚ ♣ â ♣ ú ✆ ✜ ♣ ú ✝ ï ñ ò ó ô ♣ ú ✆ Õ æç✬è é ♣ ✆ ê ï ñ ò ó õ ♣ ú ✝ ï ñ ò ó Õ æç è é ♣ ✝ ê å á â ♣ ú ✆ ï ñ ò ó ô ♣ ú ✆ ï ñ ò ó Õ æç✬è é ♣ ✆ ê õ ♣ ú ✝ ï ñ ò ó ✛ Õ æç è é ♣ ✝ ê å á â ♣ ú ✝ ï ñ ò ó ô ♣ ú ✆ ï ñ ò ó ✛ Õ æç✬è é ♣ ✆ ê õ ♣ ú ✝ ï ñ ò ó Õ æç è é ♣ ✝ ê å ♣ ù ♣ ✆ ✜ ♣ ✝

David Toman

slide-38
SLIDE 38

37

Example

The

✢ ✣ ✤
  • perator applied on the subquery
✼ ❃ ✓ ✗ ❃❅❄ ✙ ❃ ✓ ❆ ❃ ❄ ❀ ✼ ✽ ✙ ✾ ✿ ✧ ❃ ✓ ✗ ✸ ✗ ✽ ✱❁❀ ✾ ✿ ✧ ❃❅❄ ✗ ✸ ✗ ✽ ✱

yields the following set of formulas:

✥ ❬ ✳ ✵ ➮ ✁✄✆ ✁ ✝ ➱ ✓ ❄ ✦ ❣ ✧ ❡ ❐ ✥ ❬ ✳ ✵ ➮ ✁ ✆ ✁ ✝ ➱ ✓ ➅ ✦ ❣ ✧ ❡ ❐ ✥ ❬ ✳ ✵ ➮ ✁✄✆ ✁ ✝ ➱ ❄ ➅ ✦ ❣ ✧ ❡ ❐ ✾ ✿ ✧ ✸ ✗ ✭✮ ✯ ✯ ✰ ✗ ❃ ❄ ✱ ➮ ✁✄✆ ✁ ✝ ➱ ✓ ã ✦ ❣ ✧ ❡ ❐ ✾ ✿ ✧ ✸ ✗ ✭✮ ✯ ✯ ✰ ✗ ❃ ❄ ✱ ➮ ✁ ✆ ✁ ✝ ➱ ❄ ã ✦ ❣ ✧ ❡ ❐ ✾ ✿ ✧ ✸ ✗ ✭✮ ✯ ✯ ✰ ✗ ❃ ❄ ✱ ➮ ✁✄✆ ✁ ✝ ➱ ➅ ã ✦ ❣ ✧ ❡ ❐ ✥ ❬ ✳ ✵ ➮ ✁ ✆ ✁ ✝ ➱ ❄ ★ ✩✫✪ ♥ ❐ ✾ ✿ ✧ ✸ ✗ ✭✮ ✶ ✷ ✯ ✗ ❃ ❄ ✱ ➮ ✁✄✆ ✁ ✝ ➱ ❄ ã ✩✫✪ ♥ ❐ ✾ ✿ ✧ ✸ ✗ ✭✮ ✶ ✷ ✯ ✗ ❃ ❄ ✱ ➮ ✁✄✆ ✁ ✝ ➱ ★ ã ✩✫✪ ♥ ❐

David Toman

slide-39
SLIDE 39

38

Duplicate Information Removal

Modify the

✢ ✣ ✤

for quantification over time:

✧ ✼ ❃ ✙ ✆ ú ✆ ✟ ñ ð ò Ù ✍ ✎ ✏✑ è ✓ ✆ ✆ ✔ Ò Õ ✬ ✭ ò é ✁ ê ✮ ➨

what is this??

❍ ➬ ✓ ✱ ➮ Û Ô ❐

where

❍ ➬ ➬ ✓ ➮ Û ✁ Ô Ò ❐ Ï ✢ ✣ ✤ ✧ ❍ ✓ ✱

for some

Ó

Definition 1: Let

❍ ✓ ➮ Û ✁ Ô Ò ✆ ❐ ✗ ❍ ❄ ➮ Û ✁ Ô Ò ✝ ❐ Ï ✢ ✣ ✤ ✧ ❍ ✱

for

Ó ✓ Ñ ❊ Ó ❄

. We define

➮ Û ✁ Ô Ò ✆ ❐ ➻ ❞ ♣ ➮ Û ✁ Ô Ò ✝ ❐

iff for any extension

✤ ➬
  • f
✤ ✧✰✯ ✗ Ó ✓ ✱ Ï ❍ ✧ ✤ ✢ ✤ ➬ ✱ ✱ ✔ ✧ ✯ ✗ Ó ❄ ✱ Ï ❍ ✧ ✤ ✢ ✤ ➬ ✱

Definition 2:

✲ ✳ Ô ✧ ❃ ✱

is the set of representatives of the

➮ Û ✁ Ô Ò ✆ ❐ ➻ ❞ ♣ ➮ Û ✁ Ô Ò ✝ ❐

equivalence classes [min in time order].

David Toman

slide-40
SLIDE 40

39

Equivalence in Extensions

♣ ë Ö

:

ï ñ ò ➉ ó ➵ × ✆ ï ñ ò ➢ ó ✴✵ é é ♣ ✆ ë ♣ ✝ ë

true

ê ✜ é Ô ✆ ë Ô ✝ ê ê ♣ ë ♣ ú ü ý

:

ï ñ ò ➉ ó ➵ × ✆ ï ñ ò ➢ ó ✴✵ ✶ ï ñ ò ➉ ó ➵ × ✆ ✞ ï ñ ò ➢ ó

where

ï ñ ò ➉ ó ü ý

and

ï ñ ò ➢ ó ü ý

are satisfiable

✷ õ ♣ ë
  • ✁✄✂
♣ ú

: Let

☎ ✆ ë â ✕ ô ♣ ú ✆ ï ✖ ñ ✗ ò ➉ ó Õ æç è é ♣ ú ê å

,

☎ ✝ ë â ✕ ô ♣ ú ✝ ï ✖ ñ ✗ ò ➢ ó Õ æ ç✬è é ♣ ú ê å

.

ï ñ ò ➉ ó ➵ × ✆ ï ñ ò ➢ ó ✴✵ ✶ é ✸ ✕ Õ ☎ ✆
Õ ☎ ✝ ✂ ï ✖ ñ ✗ ò ➉ ó ➵ × ✆ ✞ ï ✖ ñ✺✹ ò ➢ ó ê ü é ✸ ➺ Õ ☎ ✝ ✕ Õ ☎ ✆ ✂ ï ✖ ñ ✗ ò ➉ ó ➵ × ✆ ✞ ï ✖ ñ✺✹ ò ➢ ó ê ✷ õ ♣ ë
✂ ♣ ú

: Let

☎ ✆ ë â Ò ô ♣ ú ✆ ï ð ñ Ù ò ➉ ó Õ æç è é ♣ ú ê å

,

☎ ✝ ë â Ò ô ♣ ú ✝ ï ð ñ Ù ò ➢ ó Õ æ ç✣è é ♣ ú ê å

.

ï ñ ò ➉ ó ➵ × ✆ ï ñ ò ➢ ó ✴✵ ✶ é ✸✼✻ Õ ☎ ✆
  • Ò
Õ ☎ ✝ ✂ ï ð ñ✾✽ ò ➉ ó ➵ × ✆ ✞ ï ð ñ Ù ò ➢ ó ê ü é ✸ ✻ Õ ☎ ✝
  • Ò
Õ ☎ ✆ ✂ ï ð ñ✾✽ ò ➉ ó ➵ × ✆ ✞ ï ð ñ Ù ò ➢ ó ê ✷ õ ♣ ë ♣ ú ü ♣ ú ú

:

ï ñ ò ➉ ó ➵ × ✆ ï ñ ò ➢ ó ✴ ✵ ✿ ï ñ ✞ ò ✞ ➉ ó ➵ × ✆ ✞ ï ñ ✞ ò ✞ ➢ ó ü ï ñ ✞ ✞ ò ✞ ✞ ➉ ó ➵ × ✆ ✞ ✞ ï ñ ✞ ✞ ò ✞ ✞ ➢ ó õ

for

ï ñ ò ❀ ó ë ï ñ ✞ ñ ✞ ✞ ò ✞ ❀ ò ✞ ✞ ❀ ó

satisfiable

❁ õ ♣ ë ♣ ú ü ✚ ♣ ú ú
  • r
♣ ë ♣ ú ✜ ♣ ú ú

:

ï ñ ò ➉ ó ➵ × ✆ ï ñ ò ➢ ó ✴ ✵ ✶ ï ñ ò ➉ ó ➵ × ✆ ✞ ï ñ ò ➢ ó ü ï ñ ò ➉ ó ➵ × ✆ ✞ ✞ ï ñ ò ➢ ó ✷ ✂

David Toman

slide-41
SLIDE 41

40

Example

❂ ➮ ❃✼❄ ❃✼❅ ➱❇❆ ❄ ✦ ❣ ✧ ❡ ❐❉❈ ➮ ❃ ❄ ❃✼❅ ➱❇❆ ➅ ✦ ❣ ✧ ❡ ❐❉❈ ➮ ❃ ❄ ❃ ❅ ➱ ❄ ➅ ✦ ❣ ✧ ❡ ❐ ❊ ❈ ❂●❋ ❃✫❄ ❃✫❅ ❍ ❆❏■ ❑▼▲ ◆✼❖ P❉❈ ❋ ❃ ❄ ❃✫❅ ❍ ◗ ■ ❑▼▲ ◆✼❖ P❉❈ ❋ ❃ ❄ ❃ ❅ ❍ ❘ ■ ❑▼▲ ◆✼❖ P ❊ ❈ ❂●❋ ❃✼❄ ❃✼❅ ❍ ◗ ❙ ❚✫❯ ❱ P ❊ ❈ ❂❲❋ ❃✼❄ ❃✼❅ ❍ ◗ ■ ❚ ❯ ❱ P ❈ ❋ ❃✼❄ ❃✼❅ ❍ ❙ ■ ❚✫❯ ❱ P ❊

David Toman

slide-42
SLIDE 42

41

Residual History Reconstruction

Specialization-based expiration:

❨ ❩ ❬ ❭ ❪ ❫ ❴ ❵ ❩ ❨ ❭ ❩ ❛ ❭ ❫ ❴ ❵❝❜ ❵ ❞ ❩ ❨ ❭ ❡ ❫ ❴ ❵ ❞ ❩ ❫ ❴ ❵ ❩ ❨ ❭ ❭ ❳

We use

❫ ❴ ❵ ❩ ❨ ❭

to construct

❢ ❩ ❬ ❭ ❣

for each temporal variable

❤❥✐

we define a unary relation

❦ ✐ ❩ ❤ ❭ ❪ ❧ ♠ ♥ ❧ ❩ ❤ ❭❉♦ ❣

each quantifier

♣ ❤ ✐ ♦ ❨ q

in

is restricted to

❦ ✐ ❩ ❤ ❭ ❣

a state

rts ✉ ❬

is expired if

✈ ✇ ✉ ① ✐ ❦ ✐

.

David Toman

slide-43
SLIDE 43

42

Example

♠ ♥ ◗③② ❑▼▲ ◆✼❖ ❩ ❤ ❆ ❭ ❪ ④ ⑤ ⑥ ♠ ♥ ❘ ② ❑▼▲ ◆✼❖ ❩ ❤ ❆ ❭ ❪ ④ ⑤ ⑥ ♠ ♥ ■ ② ❑▼▲ ◆✼❖ ❩ ❤ ❆ ❭ ❪ ④ ⑤ ⑥ ♠ ♥ ❙ ② ❚✫❯ ❱ ❩ ❤ ❆ ❭ ❪ ④ ⑦ ⑥ ♠ ♥ ■ ② ❚✫❯ ❱ ❩ ❤ ❆ ❭ ❪ ④ ⑦ ⑥ ❣

is sufficient to keep only states

⑤ ⑧ ⑨ ⑩ ⑦

as valuations for the variable

❤ ❆

.

David Toman

slide-44
SLIDE 44

43

Properties of the Expiration Operator

❳ ❨ ❩ ❬ ❶ ❬ q ❭ ❪ ❨ ❩ ❢❸❷ ❩ ❬ ❭ ❶ ❬ q ❭

for all

❬ ❹ ❬ q

histories and

FO query

❳ ❺ ❢❸❷ ❩ ❬ ❭ ❺❼❻ ❽ ❩ ❺ ❾ ❿ ➀ ➁ ❺ ❹ ❺ ❨ ❺ ❭

,

is an exponential tower in number of nested

.

❳ ❺ ❢➂❷ ❩ ❬ ❭ ❺❼❻ ❺ ❬ ❺➄➃ ❺ ❾ ❿ ➀ ➅ ❺ ❺ ❨ ❺

. . . and can be implemented by FO queries/updates.

David Toman

slide-45
SLIDE 45

44

Space: Lower Bound

Example:

♣ ❤✰➆ ❹ ❤ ◗ ♦ ❤ ➆ ➇ ❤ ◗ ➈ ➉❸➊ ♦ ➋ ❩ ❤✰➆ ❹ ➊ ❭ ➌ ❣ ➋ ❩ ❤ ◗ ❹ ➊ ❭ ❳

Potentially we need to keep all states for which

contains distinct subsets of

❾ ❿ ➀ ➁ ❣

potentially all subsets of

❾ ❿ ➀ ➁ ❣

therefore any expired history is exponential in

❺ ❾ ❿ ➀ ➁ ❺

.

extended to sequences of states yields more exponents.

David Toman

slide-46
SLIDE 46

45

Limits of Bounded Encoding

Clearly, this cannot work for all possible queries: Example 1: Query

④ ❤✼➍ ➋ ❩ ❤ ❭ ⑥

.

answer

➎ ❺ ❾ ❿ ➀ ➅ ❬ ❺

Example 2: Query

④ ❤✼➍ ➋ ❩ ❤ ❭ ➈ ➉ ❤ q ♦ ➋ ❩ ❤ q ❭ ➏ ❤ ➐ ❤ q ⑥

.

answer

➎ ➑➂➒ ➓ ❩ ❺ ❾ ❿ ➀ ➅ ❬ ❺ ❭

David Toman

slide-47
SLIDE 47

46

Counting

Example: “is the number of states containing

greater that the number of states containing

?”

we need

➣ ❩ ➑➂➒ ➓ ❩ ❺ ❾ ❿ ➀ ➅ ❺ ❭ ❭

space to represent counter(s)

❣ ↔ ❩ ➑➂➒ ➓ ❩ ❺ ❾ ❿ ➀ ➅ ❺ ❭ ❭

is sufficient. Conjecture: we can use the above technique (but remember counts of the expired values) to answer queries with counting

❣ ❢ ❷ ❩ ❬ ❭ ❺ ❻ ↕ ➙ ➛ ➜ ❩ ➑➂➒ ➓ ❩ ❺ ❾ ❿ ➀ ➅ ❺ ❭ ❭

David Toman

slide-48
SLIDE 48

47

Duplicates

Example (in SQL-style syntax): ( select ’1’ from R where R.x=’a’ ) except all ( select ’1’ from R where R.x=’b’ ) is nonempty if and only if the number of states containing

is greater that the number of states containing

→ ❣

just like counting . . .

David Toman

slide-49
SLIDE 49

48

Retroactive Updates

Example: while

♣ ❤ ♦ ➋ ❩ ❤ ❹ ➔ ❭ ➈ ♣ ❤ ♦ ➋ ❩ ❤ ❹ → ❭

do { while both

and

exist in

} delete

➋ ❩ ❤ ❹ ➔ ❭

where

➉ ❤ q ♦ ➋ ❩ ❤ q ❹ ➔ ❭➞➝ ❤ q✄➟ ❤

; { delete (chronologically) first

} delete

➋ ❩ ❤ ❹ → ❭

where

➉ ❤ q ♦ ➋ ❩ ❤ q ❹ → ❭➞➝ ❤ q➠➟ ❤

; { delete (chronologically) first

} return

♣ ❤ ♦ ➋ ❩ ❤ ❹ ➔ ❭

{ return true if

contains an

}

we need

➣ ❩ ➑➂➒ ➓ ❩ ❺ ❾ ❿ ➀ ➅ ❺ ❭ ❭

space to represent counter(s)

just like for counting . . .

David Toman

slide-50
SLIDE 50

49

Infinite Histories

Definition 6 Let

be a finite history,

a query (in an appropriate query language), and

a substitution.

❳ ➡

is a potential answer for

with respect to

if there is an infinite completion

❬ q
  • f

such that

❬ q ❹ ➡ ❺ ❪ ❨

.

❳ ➡

is a certain answer for

with respect to

if for all infinite completions

❬ q
  • f

we have

❬ q ❹ ➡ ❺ ❪ ❨

. The notion of potential answer is a direct generalization of the notion of potential constraint satisfaction [Chomicki, 1995].

David Toman

slide-51
SLIDE 51

50

Infinite Histories (cont.)

Proposition 7 ([Gabbay et al., 1994]) The satisfaction problem for two dimensional propositional temporal logic over natural numbers-based time domain is not decidable. Proposition 8 ([Chomicki, 1995]) For past formulas potential constraint satisfaction is undecidable. Proposition 9 ([Chomicki and Niwinski, 1995]) For biquantified formulas with no internal quantifiers (called universal), potential constraint satisfaction is decidable (in exponential time). For biquantified formulas with a single internal quantifier, potential constraint satisfaction is undecidable.

David Toman

slide-52
SLIDE 52

51

Related Issues

garbage collection in programming languages

temporal/dynamic integrity constraint enforcement

model checking

materialized view maintenance

self-maintainable views and expiration for SAGAs

David Toman

slide-53
SLIDE 53

52

Open Problems

  • FutureTL. expiration operator for full FutureTL

combined Past-Future TL? Fixpoints in 2-FOL. Rich Temporal Domains. more than linear

❻ ❣

constraint database techniques? [Libkin et al., 2000] Space Bounds For Aggregate Queries.

a weaker bound, e.g.,

❺ ❢ ❬ ❺ ✉ ➙ ❩ ➑➂➒ ➓ ❩ ❺ ❾ ❿ ➀ ➅ ❬ ❺ ❭

? Query Languages with Decidable Potential Answers.

Optimal Expiration Operators?

David Toman

slide-54
SLIDE 54

53

Acknowledgment

Part of this research was done while visiting

BRICS

Centre for Basic Research in Computer Science funded by the Danish National Science Foundation.

The research was supported by the National Sciences and Engineering Research Council of Canada (NSERC).

The material (pending revisions) will appear in

  • J. Chomicki, G. Saake, and R. van der Mayden:

Logics for Emerging Applications of Databases, Springer ’03.

http://db.uwaterloo.ca/~david/book-lead.ps

David Toman

slide-55
SLIDE 55

References

[Abiteboul et al., 1996] Abiteboul, S., Herr, L., and Van den Bussche, J. (1996). Temporal Versus First-Order Logic to Query Temporal Databases. In ACM SIGACT-SIGMOD-SIGART Symposium

  • n Principles of Database Systems, pages 49–57.

[Chomicki, 1995] Chomicki, J. (1995). Efficient Checking of Temporal Integrity Constraints Using Bounded History Encoding. TODS, 20(2):149–186. [Chomicki and Niwinski, 1995] Chomicki, J. and Niwinski, D. (1995). On the Feasibility of Checking Temporal Integrity Constraints. Journal of Computer and System Sciences, 51(3):523–535. [Chomicki and Toman, 1998] Chomicki, J. and Toman, D. (1998). Temporal Logic in Information Sys-

  • tems. In Chomicki, J. and Saake, G., editors, Logics for Databases and Information Systems, pages

31–70. Kluwer. [Gabbay et al., 1994] Gabbay, D. M., Hodkinson, I. M., and Reynolds, M. (1994). Temporal Logic: Mathematical Foundations and Computational Aspects. Oxford University Press. [Jensen, 1995] Jensen, C. S. (1995). Vacuuming. In Snodgrass, R. T., editor, The TSQL2 Temporal Query Language, pages 447–460. [Libkin et al., 2000] Libkin, L., Kuper, G., and Paredaens, J., editors (2000). Constraint Databases. Springer. [Lipeck et al., 1994] Lipeck, U. W., Gertz, M., and Saake, G. (1994). Transitional Monitoring of Dynamic Integrity Constraints. IEEE Data Engineering Bulletin. [Lipeck and Saake, 1987] Lipeck, U. W. and Saake, G. (1987). Monitoring Dynamic Integrity Con- straints Based on Temporal Logic. Information Systems, 12(3):255–269. [Toman and Niwinski, 1996] Toman, D. and Niwinski, D. (1996). First-Order Queries over Temporal Databases Inexpressible in Temporal Logic. In Advances in Database Technology, EDBT’96, volume 1057, pages 307–324. Springer.

slide-56
SLIDE 56

[Yang and Widom, 1998] Yang, J. and Widom, J. (1998). Maintaining Temporal Views over Non- Temporal Information Sources for Data Warehousing. In Advances in Database Technology, EDBT’98, pages 389–403. [Yang and Widom, 2000] Yang, J. and Widom, J. (2000). Temporal View Self-Maintenance. In Ad- vances in Database Technology, EDBT’00, pages 395–412.