Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 8. Safe Query Languages Safe program – its semantics can be at least partially computed on any valid database input. Safety is tied to program verification,

Similar presentations


Presentation on theme: "1 8. Safe Query Languages Safe program – its semantics can be at least partially computed on any valid database input. Safety is tied to program verification,"— Presentation transcript:

1 1 8. Safe Query Languages Safe program – its semantics can be at least partially computed on any valid database input. Safety is tied to program verification, because only safe programs are correct. Safety is a concern in any programming language. It is undecidable in general (Halting problem). Is it possible to verify in certain cases that a query is safe?

2 2 8.1 Safety Levels Closed form – output database contains same type of constraints as the input database. Evaluation – output database may contain more complex constraints than the input database. Recognition – any tuple can be tested to be in the output  -Recognition – for any tuple a it can be tested whether the output contains a tuple b such that | a i – b i | <  for all i. Approximation – lower, upper bounds can be given for output

3 3 8.2 Restriction Restriction – only allow certain combinations of (constraints, queries) to guarantee safety. Advantage: easy to check Disadvantage: limits flexibility and expressiveness

4 4 8.4 Safe Refinement and Projection Queries Refinement queries: always safe because they only add constraints. Projection queries: closed-form evaluable if the UOR contains only Linear constraints Addition constraints Polynomial constraints


Download ppt "1 8. Safe Query Languages Safe program – its semantics can be at least partially computed on any valid database input. Safety is tied to program verification,"

Similar presentations


Ads by Google