Information Technology Reference
In-Depth Information
In the case of each type of data server, the data items shipped from the server
are processed (read and written) at the clients. In fact the entire query processing
(parsing, optimization, execution) of an SQL query or update operation is performed
at the clients. In that way only it is possible for a client to request a certain object,
page, or file from the server. Every transaction is executed from the start to the end
at a single client.
Most of transaction processing is thus the responsibility of the clients: a client
starts a transaction (generates a transaction identifier), maintains its own active-
transaction and modified-page tables, writes log records for the transaction, executes
the actions of the transactions on the data cached at the client, and terminates
(commits or aborts and rolls back) the transaction.
Example 14.1 Consider the transaction generated by the following fragment of an
application program:
exec sql update r set V = 2 V ;
exec sql select sum (V ) into : new_sum from r ;
exec sql commit .
The execution of this transaction on a centralized database system was con-
sidered in Example 1.1 and on a distributed database system in Example 13.1 .
The execution of the transaction at a client c of a page-server system involves the
following:
1. Client c generates a new transaction identifier T , generates the begin-transaction
log record for T , appends it to the log buffer at c, and inserts the transaction
record of T into the active-transaction table at c.
2. Client c requests from the server system-catalog pages to be cached at c for
reading until it finds the catalog information for relation r .
3. Using the catalog information cached at c, the query optimizer at c determines
an execution plan for the update statement: table scan of the data pages of r .
4. For each data page p of r , client c requests from the server the page p to be
cached at c for updating, updates the V attribute in every tuple in page p,and
logs the updates.
5. Using the catalog information cached at c, the query optimizer at c determines
an execution plan for the select statement: again a table scan of the data pages
of r .
6. For each data page p of r , if the page is no longer cached at c, client c requests
from the server the page to be cached at c for reading and sums up the V values.
7. Client c logs T as committed and ships the log records in the log buffer to the
server with a request to flush the log onto disk.
8. Upon receiving an acknowledgment from the server, client c releases all locks
held by T and deletes T 's transaction record from the active-transaction table.
These steps leave open some important questions: how the system keeps track
of pages cached at the clients and the mode of caching (for reading, for updating)
and how it ensures compatibility of locks granted by different clients on cached data
items.
Search WWH ::




Custom Search