Académique Documents
Professionnel Documents
Culture Documents
System
By
Sudarshan
MCA Sem V
Objects and OIDs
• Example
Several space probes continuously records a
video.
A single video stream is associated with each
probe, and while this stream was collected
over a certain time period, we assume that it
is now a complete object associated with the
probe.
During the time period over which the video
was collected, the probe’s location was
periodically recorded.
The information associated with a probe has
three parts
- a probe ID
RDBMS Design
Probes(pid: integer, time: timestamp, lat: real,
long: real, camera: string, video: BLOB)
pid camera
Display(start,end)
Listof(row(time, lat, long))
video
Probes
Using Nested Collections
Query Processing
• User defined Aggregation function
– New aggregate functions to be defined.
– To register new aggregate function, a user
must implement three methods
• Initialize
• Iterate
• Terminate
ORDBMS Implementation Challenges - 2
• Method Security
– ADT gives the power to add code to the
DBMS
– DBMS must have mechanisms to prevent
buggy or malicious code from causing
problem.
– User methods can be interpreted rather
than complied.
– Allow complied methods but run those
methods in a different address space that
the DBMS. (Use of IPC)
ORDBMS Implementation Challenges - 2
• Method caching
– ADT methods can be expensive to execute
and can account for bulk of time spent on
query execution.
– During query processing it may make sense
to cache the results, in case they can be
used again.
– Within the scope of a single query, one can
avoid calling a method twice on duplicate
values in column by either sorting the table
or using hashing techniques.
– An alternative is to maintain a cache of
ORDBMS Implementation Challenges - 2
• Pointer Swizzling
– In some applications, objects are retrieved into
memory and accessed frequently through their
oids.
– Some system maintain the table of oid that are
currently in memory.
– When an object O is brought into memory, they
check each oid contained in O and replace oids of
in-memory objects by in-memory pointers to those
objects. This technique is called “Pointer
Swizzling” and makes references faster.
– Caution: if an object is paged out, in-memory
reference to it must be invalidated and replaced
with oid.
ORDBMS Implementation Challenges - 3
Query optimization
• Registering Indexes with the optimizer
– The optimizer must be informed about the new
index structures.
– The optimizer must know
• What WHERE-clause conditions are matched by that index
• What is the cost of fetching a tuple for that index
– Optimizer can use any index structure in
constructing a query plan.
• Reduction factor and cost estimation for ADT
methods
– For user defined conditions such as is_sunrise(),
the optimizer needs to estimate reduction factor.
– Users who register the method can also specify the
methods cost as a number, typically in units of the
ORDBMS Implementation Challenges - 3
• OQL:
– OQL is similar to SQL,with a select-from-
where syntax,
– Supports structured type, (arrays, set, bag,
list)
– Allows aggregate operations on structured
type.
• COUNT
– Supports reference type, path expressions,
ADT’s, inheritance, nested queries etc.
– Has a standard Data Definition Language as
ODL.
ODMG Data Model
interface Theater
(extent Theaters key theaterName)
{ attribute string theaterName;
attribute string address;
attribute integer ticketPrice;
relationship Set<Movie> nowShowing inverse
Movie:: shownAt;
float numshowing() raises(errorCountingMovies);
}
ODL Definitions