Professional Documents
Culture Documents
Cornell University
Ithaca, NY 14853, USA
{sudip,lucja}@cs.cornell.edu
ABSTRACT
We introduce quantum databases, a new database abstraction that
allows to defer the making of choices in transactions until an application or user forces the choices by observation. Conceptually, a
transaction is in a quantum state in one of many possible worlds,
which one is unknown until fixed by observation. Practically, our
abstraction enables late binding of values read from the database.
This allows more transactions to succeed in environments with high
contention. This is particularly important for applications in which
transactions compete for scarce physical resources represented by
data items in the database, such as seats in airline reservation systems or meeting slots in calendaring systems. In such environments, deferral of the assignment of resources to consumers until
all constraints are available to the system will lead to more successful transactions. Through entanglement of queries and transactions, a notion that we have explored in previous work, quantum
databases can enable collaborative applications with a constraint
satisfaction aspect directly within the database system.
1.
INTRODUCTION
EPFL
CH-1015 Lausanne, Switzerland
christoph.koch@epfl.ch
reserve plane tickets some time in advance and there is time on the
order of days or months between the time the booking transaction commits and the time the seat actually needs to be used.
In this paper, we observe that both flexibility and the time delay from resource request to usage can and should be exploited by
the system for optimal resource allocation. The system can exploit user flexibility by explicitly keeping track of preferences and
dont cares; it can also exploit the delay by deferring resource
allocation as late as possible. Usually, requests for resources arrive
over time from different users and the system has no knowledge of
the future request sequence. Allocating a resource too early may
prevent other requests from being fulfilled; for example, if a traveler Mickey who does not care about his seat is assigned the
last available window seat on a plane, a subsequent user who only
wants a window seat may be turned away, unless Mickey is willing
to be reseated to an aisle seat. Reseating Mickey could be nontrivial and may require executing compensation logic; for example if
he is traveling with his family and they all want to sit in the same
row several people may need to be reseated.
Deferral of resource assignment can not only improve global
utility, but the individual users experience as well. For example,
Mickey might have a preference for flying Delta, but if there are no
such available flights, he is willing to fly any other airlines. It is
possible that there are no seats available on Delta when Mickey
submits his transaction; however, a seat may open up due to a
cancellation in the future. If Mickeys flight plans have not been
finalized yet, the system can automatically reassign Mickeys
seat at this point. Moreover, users may specify more sophisticated
requests that involve coordination with other users. Formalisms
such as entangled and enmeshed queries [8, 3] make it possible
for Mickey to specify requests such as I want to sit next to my
friend Goofy (who will be booking his seat separately). If Goofys
seat request does not arrive in the system until much later, it is
again desirable to defer seat assignment to maximize the chance
that Mickey and Goofy can sit together.
Calendar management is another application domain where resource allocation is challenging. Users who schedule meetings often have flexibility in their respective calendars, but current software forces everyone to commit to a particular date and time, even
if the meeting is months away. Anecdotal evidence suggests that
such arbitrarily chosen time slots frequently end up conflicting with
short-notice higher-priority meetings. For example, suppose Mickey
schedules a work offsite with his team two months in advance for a
Friday afternoon and everyone on the team makes sure to keep that
time slot free. Now, suppose that on the Wednesday before the offsite, Mickey is notified that he needs to join a high-priority meeting
with the company CEO on Friday afternoon. Mickey now needs to
reschedule the offsite, taking into account the availability of all his
2.
RESOURCE TRANSACTIONS
for the majority of our use cases. Requesting a resource and performing a set of blind writes to reserve the resource is by far the
most common pattern used in resource allocation applications.
In the rest of the paper we use a Datalog-like notation for representing resource transactions, which is a straightforward equivalent
of the SQL representation. Each transaction is denoted as follows:
U : 1 B
U and B are conjunctions of relational atoms. We call B the body
of the transaction, and U the update portion of the transaction. Any
variables appearing in U must also appear in B (this is a rangerestriction requirement). Each atom in U is either a delete (denoted
with a leading ) or an insert (denoted with a leading +) of a single tuple into the database. Optional conditions are underlined and
the CHOOSE 1 is denoted by : 1 . For example, the intermediate
representation for the example in Figure 1 is as follows, with A,
B, Adj, M and G abbreviating Available, Bookings, Adjacent,
Mickey and Goofy respectively.
A( f1 , s1 )
A( f1 , s1 ), +B(M, f1 , s1 ) : 1
B(G, f1 , s2 ) Adj(s1 , s2 )
The body of the transaction contains three atoms. The first specifies that the variable s1 should be an available seat for Mickey. The
two subsequent optional atoms specify that s2 should be a seat adjacent to s1 that is already reserved by Goofy. The update portion
of the transaction specifies that once a suitable s1 is found, appropriate changes should be made by deleting a tuple from Available
and inserting a tuple into Bookings.
A detailed presentation of the semantics of resource transactions
requires formalizing the deferred value assignment model mentioned in the Introduction. As described in detail in Section 3,
the actual assignment of values to variables and execution of
the FOLLOWED BY clause happens after the transaction has already
committed. In this Section, we give a high-level intuitive overview
of the semantics. First, we explain the semantics a resource transaction would have without the deferred assignment model, and then
explain how deferred assignment both complicates certain things
and presents certain unique opportunities.
A system that processes resource transactions without deferred
assignment would proceed as follows. First, the body of a resource
transaction is grounded, i.e., each variable is assigned one specific
value from the database. For example, s1 might be assigned the
value 5A, f1 might be assigned 123 (if 123 is a flight to Los Angeles), and s2 might be assigned 5B (if this is the seat Goofy has
already booked). We use the term grounding and (value) assignment interchangeably in the rest of the paper. Sometimes it may not
be possible to find a value assignment that satisfies all the optional
clauses; this is expected and permitted by the semantics, although
if there is an assignment that satisfies the optional clauses it must
be chosen in preference to one that does not. Once the grounding
is finalized, the system makes appropriate changes to the database
as specified in the update portion.
Quantum databases implement a variant of the above semantics
in a setting where value assignment is not immediate, but rather
deferred until after the commit of the transaction. As explained
in the Introduction, instead of grounding and executing the update
portion, the system maintains a guarantee that at least one suitable
grounding for the committed transaction exists at all times. Once
it is necessary or desirable to actually make the updates for example, once Mickey is at the airport and checking in for his flight
then the system chooses a grounding and performs appropriate
database writes. In terms of the programming API, the application
3.
QUANTUM DATABASES
3.1
Consider for a moment an execution model for resource transactions where value assignment is not deferred. Rather, at the time the
transaction is executed, suppose the system finds all possible values
that could be assigned all possible flights and seats for Mickey,
say and forks the database state into several possible worlds. In
the first possible world, Mickey gets assigned the first available
seat, in the second he gets the second one, and so on. This yields a
large, but finite set of possible worlds, each of which is a concrete
database in which Mickey has a concrete seat on a concrete flight.
Suppose we now maintain all these possible worlds explicitly as
our database state. Other resource transactions can run on each
possible world as well and cause another forking of the state;
for example, if Donald now submits a transaction, the system can
create one possible world for each of Donalds possible seat assignments. If Donald only wanted a window seat, and there was only
one available window seat, this would eliminate all worlds in which
Mickey got that window seat. In other words, all worlds in which
Donalds transaction cannot commit are eliminated. This is illustrated in Figure 2; we assume that there is only one available flight
to LA, number 123, for simplicity. Now, suppose that Minnie submits a transaction of her own, requesting to sit next to Mickey. The
new set of possible worlds is as shown in the final panel in Figure
2.
Suppose Mickey eventually needs to check-in and actually needs
to know i.e., read his seat. Our goal is to make the existence of
possible worlds invisible to the transaction. However, the read may
have a different value depending on the possible world that it occurs
in. Therefore, the system is forced to choose one possible value for
the read and collapse the uncertainty as required so that this is
the correct value read. All possible worlds consistent with the read
are retained, and all others are discarded. It may so happen that
some of his optional conditions cannot be satisfied in any world, in
which case the world in which the maximum number of conditions
are satisfied is preserved.
Of course, the number of possible worlds in the above setup
would grow at an exponential rate as new transactions are processed. Therefore, an extensional representation of these worlds
as described above is not practical. We can, however, represent the
possible worlds intensionally in a concise way, and this is the idea
behind our true quantum database abstraction.
At a very high level, a quantum database consists of an extensionally specified portion, which is the same in all possible worlds,
and an ordered sequence of pending transactions more precisely,
committed transactions whose value assignments are still pending.
To avoid cascading rollbacks and enforce serializability, it is necessary to guarantee two things first, all the pending value assignments can be made successfully, and second, any reads on the
database issued by transactions serialized after a pending transaction are handled correctly. Both of these requirements are challenging to enforce. The former requires ensuring the existence of
a successful grounding for the body of each pending transaction,
when these transactions are executed in a sequence. The latter requires defining what dependence between transactions really means
in the case of deferred value assignments, and accurately identifying pending transactions that may affect the result of a read.
More formally, we define a quantum database as follows.
Definition 3.1 (Quantum Database). Let D be a completely extensional initial database. Also, let T 0 , . . . , T N be a sequence of N
b represource transactions. A quantum database, denoted as D,
resents the set of all possible database states obtained from D by
applying the operations in U0 through U N under consistent ground-
3.2
3.2.1
As new resource transactions arrive and are processed, the system constructs a single logical formula whose satisfiability corresponds to the existence of a consistent set of groundings for all
the pending transactions. Here, we explain at a high level how
this formula is constructed. The intuition is that a sequence of resource transactions can be composed into a single resource transaction with a body that is more elaborate than the conjunction of
the respective bodies. If the body of the new resource transaction
is satisfiable on D, all the transactions are guaranteed successful
execution (i.e., the existence of a successful value assignment). If a
new resource transaction cannot be admitted in a way that preserves
satisfiability, the transaction is rejected.
We begin with a key assumption about the database D. We assume that any relation R in D that appears in the FOLLOWED BY
clause of a resource transaction has a key, i.e., satisfies set semantics. This property holds naturally in most cases; if it does not, it
can be enforced either by normalization or by introducing dummy
identifier columns.
We introduce a few definitions that are necessary for our presentation. Given a set of relational atoms containing variables and a
database D, a substitution is mapping from variables to variables
or data values from D. The most general unifier of two relational
atoms b1 and b2 is defined as follows.
Definition 3.2 (Most General Unifier). Let b1 , b2 be two atoms.
A unifier for b1 and b2 is a substitution such that (b1 ) = (b2 ).
A most general unifier (mgu) for b1 and b2 is a unifier for b1 , b2
such that for each unifier of b1 and b2 , there exists a substitution
0 for which = 0 .
Based on the definition of most general unifier, we now define a
unification predicate.
Definition 3.3 (Unification Predicate). Let b1 , b2 be two atoms.
The unification predicate for b1 and b2 , denoted , is a conjunction
Mickeys transaction
arrives
Name
Flight
Seat
Donalds transaction
arrives
Minnies transaction
arrives
Name
Flight
Seat
Mickey
123
1A
Donald
123
1B
Name
Flight
Seat
Name
Flight
Seat
Name
Flight
Seat
Mickey
123
1A
Mickey
123
1A
Mickey
123
1B
Donald
123
1C
Donald
123
1A
Minnie
123
1B
Name
Flight
Seat
Mickey
123
1B
Name
Flight
Seat
Mickey
123
1C
Quantum DB State
after Mickeys
transaction
.
.
.
.
.
.
Name
Flight
Seat
Mickey
123
1C
Name
Flight
Seat
Donald
123
1A
Mickey
123
1C
Minnie
123
1B
Donald
123
1A
(T 1 ) U1 : 1 B1
and
(T 1 ) U1 : 1 B1
(T 2 ) U2 : 1 B2
A sequential execution of T 1 and T 2 on any database D is equivalent to the execution of the transaction T 12 , given by
U1 , U2 : 1 B
B1 B2 (B2 , U1 ) if U1 is a delete
Proof. The proof is given in Appendix A.
Basically, the body of T 12 reflects the fact that there needs to be
a grounding for B1 on the original database and a grounding for B2
on the database modified by U1 ; if this modification was an insert,
this opens up the possibility that B2 could ground on the inserted
tuple. If U1 was a delete, this means B2 cannot ground on the tuple
deleted by U1 . This idea extends to more general updates involving
sets of inserts and deletes, and conjunctive queries with multiple
body atoms.
(T 2 ) U2 : 1 B2
A sequential execution of T 1 and T 2 on any database D is equivalent to the execution of the transaction T 12 , given by
(T 12 ) U1 , U2 : 1 B
where B = B1
i, j
bi2
B2 and
d1j , i1j
i, j
3.2.2
(T 1 )
(T 2 )
(T 3 )
should they be fixed? Both of these are nontrivial, and it is desirable to resolve them intelligently.
Identifying the values that must be fixed to handle a read can be
done at different levels of precision. At the highest level of generality, this question is related to the problem of computing information
disclosure through views, which is 2p -complete [14]. However, a
simple practical solution is to use a conservative criterion based on
unifiability. If a relational atom in our incoming read query unifies
with a pending update Ui from a transaction T i , the values involved
in that transaction are fixed.
Certain reads necessitate more grounding than others. For example, a read requesting the full contents of the Booking table will
cause many more groundings than a read asking only for Mickeys
seat number. The programmer should be aware that such general
reads have a potential negative impact on optimal resource allocation and should strive to avoid them. It is also possible to imagine
solutions where the programmer is provided more explicit feedback
before issuing a read on the potential consequences of that read
on the possible worlds. This might be helpful to the programmer
as he or she determines which reads to issue; on the other hand
it violates the pure quantum database model where uncertainty is
totally hidden from the programmer. Investigating the details and
usefulness of such a solution is ongoing work.
Once the system decides which values need to be fixed due to a
read, the system may still need to make a choice if more than one
satisfying assignment is available for the transactions in question.
Which specific seat among all those that are open should Mickey
receive? Generally, it is desirable to fix values in such a way as to
maximize the remaining number of possible worlds; more sophisticated application-specific heuristics may also be appropriate.
Writes: Writes are significant in a quantum database because
they may cause the formula associated with the pending transactions to become unsatisfiable. Thus, all writes to the database which
unify with the bodies of the pending transactions need to pass through
a check and are rejected if the check fails. This is analogous to the
check performed when processing a new resource transaction, with
the difference that a blind write changes the database over which
the formula must remain satisfiable rather than the formula itself.
3.2.3
Grounding
Application Clients
Resource / Non-resource Xacts
Quantum Database
Middle-Tier
Reads and
Writes to the
database
Composed
Body
Satisfiability Checker
Recovery Module
Solution Cache
LIMIT 1
SQL Query
MySQL Database
Pending Resource
Xacts Table
unless strictly necessary. The invariant associated with the quanb is, in general, order dependent. While this invariant
tum database D
guarantees successful execution for the order in which the transactions arrived, there can be other orderings of the pending transactions which have the same desired effect. Of course, reordering the transactions affects the formula introduced in Section 3.2.1
whose satisfiability guarantees successful execution of the remaining pending transactions. This means we cannot reorder pending
transactions arbitrarily, but must check for satisfiability first. That
is, we must maintain the invariant that there exists some ordering of
the remaining pending transactions under which the resulting formula is still satisfiable. Checking for all possible reorderings would
be computationally intractable as there are exponentially many of
them. A practical strategy is to check only the ordering where the
transaction under consideration is moved to the front of the current ordering. In most cases, we expect the underlying satisfiability problem to be very under-constrained (i.e. many available resources and few pending transactions) so this strategy should yield
good results.
4.
bodies small by forcibly grounding and executing some pending resource transactions as needed. Concretely, we ground transactions
to keep the maximum number of pending transactions in each partition below a parameter k; when grounding, we start with the oldest
transactions based on their arrival time in the system.
5.
EXPERIMENTS
In this section, we show the results of an experimental evaluation of quantum databases in a realistic application setting. The
aim of our evaluation is primarily twofold. One, to measure the
overhead of quantum databases over traditional databases, and second, to quantify the improvement in allocation of resources due to
deferred execution through quantum databases.
5.1
Application Scenario
5.2
Experimental Setup
We created a workload of simulated entangled resource transactions to model the output of the front-end social travel application
as described above. Our workload simulates users desiring to coordinate with their friends on flights and to sit in adjacent seats. We
compare this workload against a workload of non-entangled transactions issued by an intelligent social (IS) user. Such a user first
Order of Arrival
Characteristic
Alternate
Random
In Order
Reverse Order
Max. Number of
Pending Xacts
1
dN/2e
dN/2e
dN/2e
Table 1: Four different transaction arrival orders and the maximum number of pending transactions in the quantum database
assuming a transaction remains pending until its partner arrives.
issues a query to check whether his/her friend has an existing reservation. If so, he books the adjacent seat, and if not he books a seat
with a free adjacent seat. The IS workload simulates the kind of
coordination that is achievable without using a quantum database.
The overhead of quantum databases depends on the complexity of checking the invariants maintained by the quantum database.
Each invariant corresponds to the body of a composed transaction,
and hence the complexity of checking the invariant depends on the
number of pending transactions which are composed together. As
described in Section 5.1, an entangled resource transaction is kept
pending only until the arrival of its partner. Therefore, the order of
arrival of the transactions w.r.t. their partners determines the complexity of the invariants. Table 1 shows four possible orders of
arrival of transactions. In the Alternate arrival order, each user
transaction is followed immediately by his or her partners transaction. This only leaves a maximum of 1 pending transaction in the
quantum database. The second possible order of arrival is Random,
which orders transactions randomly and is expected to be the most
realistic. While the maximum number of pending transactions for
the Random order is N/2, it is expected to be lower on average.
Finally, the orders of arrival which lead to over half the total number of transactions to be pending are denoted as In Order and
Reverse Order. In In Order order of arrival, half the users submit their transactions followed by their respective partners in the
same order. In Reverse Order, the second half of the users submit transactions in the reverse order, i.e., the first user sits entangles
with the last user, the second user entangles with the second to last
user and so on. While the maximum number of pending transactions for both In Order and Reverse Order are the same, for
Reverse Order the period for which a transaction is kept pending
varies from 1 to N, as opposed to a constant N/2 for In Order.
We artificially generate a database of flights over which the reservation requests are issued. Each flight in our database is represented
as a set of seats arranged in rows of three. Each row has four possible adjacent pairs, only two of which can be booked simultaneously. The number of rows per flight and the number of flights in
the database are changed across experiments. Appropriate indices
are defined for each relation in the database.
In all our workloads, all coordination partners arrive in the system at some point so full coordination is theoretically achievable.
A key metric for measuring the benefit of quantum databases is
the percentage of maximum possible coordination which is actually achieved. For example, for a single flight in our database with
ten rows (103 seats), a maximum of twenty coordination requests
for adjacent seats can be accommodated, and therefore the benefit
of using quantum database is measured as the fraction of users (of
the maximum twenty) who actually are able to coordinate. The expectation is that quantum databases should allow us to significantly
increase this percentage over what is possible with an intelligent
550
Alternate
Random
In Order
Reverse Order
Random IS
2500
k=40
k=30
k=20
IS
500
450
400
2000
350
Time (s)
3000
1500
300
250
200
1000
150
100
500
50
0
0
0
20
40
60
Transaction order of arrival
80
100
Figure 5: Cumulative time of transaction execution for different orders of arrival of transactions.
Percentage of Coordination
100
80
60
40
20
0
Alternate
Random
QuantumDB
Intelligent Social (IS)
social strategy.
We ran all experiments on a 2.13GHz Intel(R) Xeon(R) E5606
with 48 GB of RAM. The MySQL query optimizer by default performs an exhaustive search over all possible query plans, and this
number grows exponentially with the number of tables referenced
in a join query [1]. Quantum database queries typically involve a
high number of joins, and therefore for default values the database
is observed to spend a disproportionate amount of time in query optimization as compared to query execution. For all our experiments,
we set the value of the parameter optimizer_search_depth to 3
to reduce the amount of time spent in query optimization without
significant change in query execution time. The reported values are
averages over 5 runs. Executable .jar files and instructions for
replicating our experiments can be found on our project website
[2].
5.3
Results
2000
4000
6000
8000
10000
Number of transactions
12000
14000
Figure 7: Scalability
180
100
160
140
k=40
k=30
k=20
Percentage of Coordination
k=40(Updates)
k=30(Updates)
k=20(Updates)
k=40(Reads)
k=30(Reads)
k=20(Reads)
Time (s)
120
100
80
60
40
80
60
40
20
20
0
0
0
20
40
60
Percentage of Reads
80
100
20
40
60
Percentage of Reads
80
100
Quantum DB
k=20
45.6
k=30
86.9
k=40
99.9
Intelligent Social
20.2
creased.
Figure 7 shows the total time taken for all transactions to complete and Table 2 shows the percentage of successful coordination
among the transactions. The percentage of coordination is dependent on the maximum number of pending transactions per flight and
as expected remains constant with respect to the number of transactions. The average values of the percentage of coordination for
different values of k is shown in Table 2. From Figure 7 it can be
seen that with smaller values of k, execution is faster since the body
of the composed transaction we must maintain and check satisfiability on has a smaller number of joins. However, the percentage
of successful coordination is lower as the system grounds transactions pre-emptively reducing the chances of successful coordination. Even for small values of k, we see a factor of 2 improvement
in coordination percentage over the IS strategy.
We investigated the unexpected increase in Figure 7 for k = 40 at
13, 500 transactions. This increase occurs due to an unexpectedly
large amount of time spent in finding the solution to the composed
body of a few transactions. Digging deeper, we saw that this is an
artifact of the MySQL query optimizer which chooses a bad query
plan for several quantum database queries. We observed that such
queries occurred rarely and only for certain random orderings. We
modified the value of optimizer_search_depth to find an alternate plan, and with an alternate plan the problem queries could be
answered about two orders of magnitude faster. We believe better query plans would eliminate this erratic behavior. An alternate
ad-hoc approach would be to ground some pending transactions to
keep the query complexity and the resulting query execution times
within acceptable limits. A more fundamental approach to solving
this problem is discussed in next section.
Our system scales linearly in terms of execution time and maintains a constant coordination percentage as the number of transactions increases. This linear increase is a consequence of the nonunification based partitioning strategy implemented by the quantum
database.
Mixed Workload: Next, we study the behavior of our system
under realistic workloads which are a mix of resource and non-
6.
DISCUSSION
7.
RELATED WORK
used to encode the check for satisfiability of pending updates. However, they are notoriously complex to design and debug, and they
are not suitable for settings requiring transactional guarantees such
as atomicity and durability.
Constraint databases [15, 11] have some conceptual similarities to quantum databases, particularly since both classes of systems work with intensional representations of state and/or relations.
However, quantum databases do not share the constraint database
goal of representing and reasoning about relations that hold over
an infinite universe. Conversely, work on constraint databases does
not focus on representing and maintaining a set of possible worlds
which changes as the database is modified. Nonetheless, we may be
able to exploit some techniques for query answering in constraint
databases to improve our system; investigating these opportunities
is future work.
8.
CONCLUSIONS
In this paper, we presented quantum databases, a novel abstraction for declarative resource allocation. We introduced the idea
of deferred execution of transactions to improve allocation of resources in a dynamic system. To make this idea practical, we proposed unification based algorithms for efficiently maintaining the
database in a partially intensional representation in the presence
of queries and other transactions. We evaluated the performance of
quantum databases over our prototype implementation in a realistic
application scenario, and demonstrated the improvement in allocation of resources due to deferred execution. We believe that research to address the quantum database-related research challenges
which we identified will expand the power of and provide insights
into multiple aspects of database engines.
9.
ACKNOWLEDGEMENTS
10.
REFERENCES
[1] http://dev.mysql.com/.
[2] http://www.cs.cornell.edu/bigreddata/youtopia/.
[3] J. Chen, A. Machanavajjhala, and G. Varghese. Scalable
social coordination with group constraints using enmeshed
queries. In CIDR, 2013.
[4] L. De Moura and N. Bjrner. Satisfiability modulo theories:
introduction and applications. Commun. ACM, 54(9):6977,
Sept. 2011.
[5] R. Dechter. Constraint Processing. Morgan Kaufmann, 2003.
[6] R. Fagin, J. Y. Halpern, Y. Moses, and M. Vardi. Reasoning
about Knowledge. MIT Press, 2004.
[7] S. Finkelstein, T. Heinzel, R. Brendle, I. Nassi, and
H. Roggenkemper. Transactional intent. In CIDR, 2011.
[8] N. Gupta, L. Kot, S. Roy, G. Bender, J. Gehrke, and C. Koch.
Entangled queries: enabling declarative data-driven
coordination. In SIGMOD, 2011.
APPENDIX
A.
Proof. Let Var1 and Var2 denote the set of variables in U1 and
U2 , respectively. We assume T 1 and T 2 have no shared variables,
i.e. Var1 Var2 = . Under the range restriction requirement for
resource transactions, Var1 and Var2 are subsets of the variables in
B1 and B2 , respectively. In the proof below, we use the standard
notion of valuation a valuation is a map from variables to values
in the database.
The proof is by cases depending on whether U1 is an insert or a
delete.
Case I : U1 is a delete
T1
T2
2 U2