Explain View management. How it is carried out in centralized and distributed DBMS?
View Management:
- Views are virtual relations that are defined as the result of a query on base relation. When a view is used in a query, view composition must take place in order to derive an execution strategy for the query. If views are not objects of authorization, this composition can take place at any site.
- If views are objects of authorization, site autonomy considerations require that the view definition site maintain control over the materialization of the view.
- Views are defined in terms of queries which may reference local and non-local tables and views. Views enable full logical data independence.
- In a relational system, a view is a virtual relation, defined as the result a query on base relations, but not materialized like a base relation, which is stored in the database.
- A view is a dynamic window in the sense that it reflects all updates to the database.
- Two the data types of views hiding, data conversion, typing elimination and renaming functions associated with views, but are not objects of authorization.
- The user posing queries against a shorthand view must be authorized to access the objects referenced by the view.
- Protection views provide the same semantics as shorthand views ana addition are objects of authorization. Authorization to access the objects referenced by the protection view belongs to the view and the user or the view only needs the privilege to use the protection view.
- Queries referencing remotely defined shorthand views will in general execute more efficiently than identical queries with shorthand views execute replaced by protection views.
Views in centralized DBMS:
View is a relation that is derived from a base relation via a query. It can involve selection, projection, aggregate functions, etc.
Example : The view of project manager derived from relation PROJECT (PNO, PTYPE, PCORDINATOR ), can be defined by the following SQL query:
PDATA
PNO PTYPE
P1 DATABASE APPLICATION
P12 BANK PROJECT
P17 MEDICAL PROJECT
P21 MECHANICAL
Solution:
CREATE VIEW PDATA (PNO, PCORDINATOR)
AS SELECT PNO, PCORDINATOR
FROM PROJECT
WHERE PCORDINATOR = "RUPALI"
The result of the query defining the view is not produced.
Example : "Find the names of all the system analysts with their project number and Responsibility ?"
Solution: This ESP, involves the view SYSAN and the relation ASG(ENO, PNO. REC DUR)
View Updates
Updatable view:
CREATE VIEW SYSAN(ENO,ENAME)
AS SELECT ENO,ENAME
FROM EMP
WHERE TITLE="Syst. Anal."
Non-updatable view:
CREATE VIEW EG(ENAME,RESP)
AS SELECT ENAME,RESP
FROM EMP, ASG
WHERE EMP.ENO=ASG.ENO
View management in DDBMS:
- Views might be derived from fragments.
- View definition storage should be treated as database storage.
- Query modification results in a distributed query.
- View evaluations might be costly if base relations are distributed.
- A materialized view stores the tuples of a view in a database relation. Access to a materialized view is much faster than deriving the view in a distributed DBMS where base relations can be remote.
- Materialized views are actual structures stored within the database and Written to disk. They are updated based on the parameters defined when they are created.
- Materialized view selection is a critical problem in many applications such as query processing, data warehousing, distributed and semantic web databases, etc.
Follow Us