Академический Документы
Профессиональный Документы
Культура Документы
Gupta
Unit 7 & 8
P.C.M.S., Chitwan
Query Processing
It refers to the range of activities involved in extracting the data from the database.
The aim is to transform a query in a high- level declarative language (SQL) into a
correct and efficient execution strategy. It contains the following steps.
Query Optimization
Query Evaluation (Execution)
Before processing the system must translating the query in the internal form. The
translation process is similar to the work performed by the parser o f a compiler. In
generating the internal form o f the qury, the parser checks the syntax of the users query,
verifies that the relation named appearing in the query are name d of the relations in the
database and son on. The system constructs a parse tree representation of the query.
Which It then translates into a relational algebra expression.
query
Parse
and
translato
r
Relational algebra
expression
Optimize
r
Query
outpur
Evaluation
engine
Execution plan
Data
Page :1
G.S.Gupta
Unit 7 & 8
P.C.M.S., Chitwan
parallel database system the cost of communication . the response time for a query
evaluation plan assuming no other activity is going on on the computer.
In large data base system the disk access are usually the most important cost since
disk access are slow compared to in memory operations. Moreover CPU speed is
much faster than the disk access so it is likely that the time spent in disk activity will
continue to dominate the total time to execute a query.
Page :2
G.S.Gupta
Unit 7 & 8
P.C.M.S., Chitwan
Set operations: Database management heavily relies on the mathematical principles of set
theory which is key in comprehending these operations.
Equivalnce of expression
Two relational algebra expression are said to be equivalent if on every legal ata base
instance, the two expression generate the same set of tuples. In SQL, the input and output
are mutisets of tuples and a multiset version of the relational algebra is used for ealuating
sql queries.
Equivalence rule
It says the expression of two form are equivalent we can replace an expression of first
form by an expression of the second form and vice versa. Since the two expression would
generate the same result on any valid database.
1.
conjuctive selection operation can be deconstructed into a sequence of
individual selection. This transformation is refrreed to as cascade of
1^ 2 (E)= 1( 2(E))
2.
selection operation are commutative.
1( 2(E))= 2( 1(E))
3.
4.
5.
6.
7.
G.S.Gupta
Unit 7 & 8
P.C.M.S., Chitwan
According to Rao (1994), "The object-oriented database (OODB) paradigm is the
combination of object-oriented programming language (OOPL) systems and persistent
systems. The power of the OODB comes from the seamless treatment of both persistent
data, as found in databases, and transient data, as found in executing programs."
In contrast to a relational DBMS where a complex data structure must be flattened out to
fit into tables or joined together from those tables to form the in-memory structure, object
DBMSs have no performance overhead to store or retrieve a web or hierarchy of
interrelated objects. This one-to-one mapping of object programming language objects to
database objects has two benefits over other storage approaches: it provides higher
performance management of objects, and it enables better management of the complex
interrelationships between objects. This makes object DBMSs better suited to support
applications such as financial portfolio risk analysis systems, telecommunications service
applications, world wide web document structures, design and manufacturing systems,
and hospital patient record systems, which have complex relationships between data.
The fundamental idea of OOPs is to combine data and function both in to a unit. Which
is called class. This idea is called encapsulation.
student
Rn
Name
Class
Calculate()
Instance of the class
When we want to use this class we have to make an object of this class which will work
Such as
Student s;
Now s is the instance of the class student
The oops provide the different features
1.
Reusability
It means one the function or class is created we can use it many time and any
where with out creating the new one. We create the instance of the class and use.
2.
extensibility
It means we can add the new things to the existing one with rewrite them
3.
polymorphism
it is too difficult to remember the name of all function in a program. But in
oops we can put the same name of all the function and they will differentiate
with each other on the basis of
a. no of passing argument
b. data type of the arguments
c. return type
4.
overloading
It means we can provide the new definition to existing operator.
Page :4
G.S.Gupta
Unit 7 & 8
P.C.M.S., Chitwan
Such as + can add two number. It can not not add the group, but in the
overloading we can provide new definition to the + to add group;
(Remaining part of unit II)
a conceptual schema (data model) describes the semantics of a domain, being the
scope of the model. For example, it may be a model of the interest area of an
organization or industry. This consists of entity classes (representing kinds of
things of significance in the domain) and relationships (assertions about
associations between pairs of entity classes). A conceptual schema specifies the
kinds of facts or propositions that can be expressed using the model. In that sense,
it defines the allowed expressions in an artificial 'language' with a scope that is
limited by the scope of the model. For generally applicable models, see below
under 'Generic data model'.
a logical schema (data model) describes the semantics, as represented by a
particular data manipulation technology. This consists of descriptions of tables
and columns, object oriented classes, and XML tags, among other things.
a physical schema (data model) describes the physical means by which data are
stored. This is concerned with partitions, CPUs, tablespaces, and the like.
The significance of this approach, according to ANSI, is that it allows the three
perspectives to be relatively independent of each other. Storage technology can change
without affecting either the logical or the conceptual model. The table/column structure
can change without (necessarily) affecting the conceptual model. In each case, of course,
the structures must remain consistent with the other model. The table/column structure
may be different from a direct translation of the entity classes and attributes, but it must
ultimately carry out the objectives of the conceptual entity class structure. Early phases of
many software development projects emphasize the design of a conceptual data model.
Such a design can be detailed into a logical data model. In later stages, this model may be
translated into physical data model. However, it is also possible to implement a
conceptual model directly.
Page :5
G.S.Gupta
P.C.M.S., Chitwan
Page :6
Unit 7 & 8