Advance Database System Ch.1 (Autosaved)
Advance Database System Ch.1 (Autosaved)
The ODMG is the data model upon which the object definition
language (ODL) and object query language (OQL) are used.
ODMG provides the data types, type constructors, and other
concepts that can be utilized in the ODL to specify object database
schemas.
Generally, ODMG provide a standard data model for OODB
☺In this stage, the query processor applies rules to the internal
data structures of the query to transform these structures into
equivalent, but more efficient representations.
1. Sorting phase
Number of file blocks (b)
Number of available buffers (nB)
Runs file = (b / nB)
2. Merging phase ( passes)
Degree of merging(dM) --- the number of runs that are merged together in
each pass
dM=Min(nB-1,nR)
Analysis of the algorithm
Number of file blocks = b
Number of initial runs = nR
Available buffer space = nB
Sorting phase: nR = (b/nB)
Degree of merging: dM = Min (nB-1, nR);
Number of passes: nP = (logdM(nR))
Number of block accesses: (2 *2021
01/20/2023
b) Acadamic
+ (2 *Year
b * (np))) 28
Number of passes =
Total Cost of external sort-merge= 2N * (# of passes)
To sort a file with N pages using B buffer pages:
Pass 0: use B buffer pages. Produce sorted runs of B pages each.
Pass 2, …, etc.: merge B-1 runs.
E.g., with 5 buffer pages, to sort 108 page file:
Pass 0: [108/5] = 22 sorted runs of 5 pages each (last run is only 3 pages)
Pass 1: [22/4] = 6 sorted runs of 20 pages each (last run is only 8 pages)
Pass 2:[6/3]= 2 sorted runs, 80 pages and 28 pages
Pass 3: [2/1] =1 Sorted file of 108 pages
Number of passes= 4(pass0,pass1,pass2 and pass3)
Total Cost of external sort-merge= 2(108) * 4=864