Database Reference
In-Depth Information
5.2. Executes the normalization (sequential translation) algorithm Nrm
:
T RA X
Mor RA in Proposition 23 , Sect. 5.2.1 . Each source object
t RA T RA X , of the obtained arrow f
:
t RA
f(t RA ) in RA , is a com-
position of the unary operators _
a,name,e
and r
_, where r
X is
# is contained in data memory
of M R , usually a table of a database; these operators are applied to the
single (temporary) relation in the IO (Input/Output) memory of M R .
These two steps specify that the Bind module implements the map-
ping Rd RE =
a relational symbol whose extension
r
Nrm
Trw
: T RE X
Mor RA in Proposition 23 (T HE COM -
PLETENESS OF RA ).
5.3. The last step is a transformation of the algebra operators contained
in these RA arrows into the variable-binding operators : Let us con-
sider an algebra operator '_ WHERE C(d 1 ,...,d n ) '
Σ RA , where the
d i
dom are the values used in the condition C . Let us substitute
these values in C by the variables, so that we obtain a condition ex-
pression C(x 1 ,...,x n ) , and then we introduce a variable-binding op-
erator '_ WHERE C(x 1 ,...,x n ) (x 1 ,...,x n ) S ', so that in a new term ' r
WHERE C(x 1 ,...,x n ) (x 1 ,...,x n ) S ' /
T RA only r is a free variable, while
x i , 1
n are the bounded variables, and the set of lists S is a parame-
ter. The set of previously obtained arrows RA will be transformed in this
way, by substituting the Σ RA operators with these new variable-binding
operators, and successively saved as an Application plan P i (executable
code for the database machine, called as ' n -operator') in the Application
Plan Catalog in Fig. 6.1 . The source object for each arrow is equal to the
resulting table of the Source-object program (contained in IO memory)
defined in step 2. During the execution of the host application program
the triple (n, 0 ,L) , with the list of values L
i
(d 1 ,...,d n ) , will be passed
as input data to the machine M R (into its IO memory) by the host lan-
guage CALLs of the Runtime Supervisor of the universal machine M U
(see Fig. 6.2 ).
Thus in the case above, we will have that S
=
, so that the
variable-binding operator above '_ WHERE C(x 1 ,...,x n ) (x 1 ,...,x n ) S '
becomes equal to the simple unary Σ RA algebraic operator '_ WHERE
C
={
L
}
[
x 1 /d 1 ,...,x n /d n ]
' where x i /d i denotes the substitution of the bounded
variable x i by the value d i
dom .
Figure 6.1 above is intended to show the major steps involved in the preparation
and execution of an RDB application. We assume that the original source program
P is written in a high-level general purpose language containing the embedded SQL
formulas. The steps that program P must go through are as follows:
1. Before P can be compiled by the regular compiler of such high-level general
purpose language, it must first be processed by the Precompiler. Its function is to
analyze a source program in any one of those languages, stripping out the SQL
statements it finds and replacing them by host language CALL statements. At
execution time those CALLs will pass control to the Runtime Supervisor. From
the embedded SQL statements it encounters the Precompiler constructs a DBRM
Search WWH ::




Custom Search