contestada

Consider a relational DBMS that has two relations: Emp (employees) and Dept (departments).
Emp(id, name, age, salary, dname)
Dept(dname, location)
- The Emp table has 500 tuples, and each tuple has a fixed length of 500 bytes. The primary key attribute "id" has a length of 40 bytes.
- The Dept table has 100 tuples, and each tuple has 200 bytes. The primary key attribute "dname" has a length of 20 bytes.
For simplicity, we assume each employee belongs to one and only one department, and each department has 5 employees. All the records are stored in 8K (8192 bytes) disk blocks. Each block uses 100 bytes for its header. Consider the following three disk-organization strategies:
- Sequential/Nonspan: All the Emp records are placed sequentially based on their id's. Similarly, all Dept records are stored sequentially based on their names. Records may not span two or more blocks.
- Sequential/Span: All the Emp records are placed sequentially based on their id's. Similarly, all Dept records are stored sequentially based on their names. Records are spanned, and spanning between blocks does not introduce additional storage cost.
- Clustered/Nonspan: For each department, its department record and its 5 employee records are stored in the same disk block. All department records are stored sequentially based on their names. We do NOT store Emp records separately. No records span two or more blocks.
For each storage organization, compute the total number of disk blocks required to store the two relations. Which of the following statements is true?
a) Sequential/Nonspan: 34 blocks.
b) Sequential/Nonspan: 30 blocks.
c) Clustered/Nonspan: 50 blocks.
d) Sequential/Nonspan: 38 blocks.

Respuesta :

All department records are stored sequentially based on their names. The cornerstone of nested-loop join is to scan the outside relation page-by-page and the inner relation page-by-page for each outer page.The correct answer is Clustered/Nonspan:30 blocks.

When S is used in a nested loop as the outer relation, the cost of joining R and S is kept to a minimum.

200 + 0 * 1000, or 200,200, is the cost.The cost of using a sort-merge join to connect R and S is equal to bS + bs * bR.

2bS(1+ceil(logB-1ceil(bS/B) + 2bR(1+ceil (logB-1ceil(bR/B) + bS + bR = 220o(1+ceil(log51ceil(200/52) + 21000(1+ceil(log51ceil(1000/52) + 200 + 1000 = 2.200(1+ceil(log514) + 2:1000.When logB-1ceil(bR/(B-1) exceeds 1, the situation is considered critical. When B reaches 15, something occurs (and B-1 becomes 14).

One input buffer page and one output buffer page, or three buffer pages, are the absolute minimum because the nested-loop strategy does not need many per-relation buffers.

buffers and that the hash function will yield a uniform distribution. The first condition is definitely met because sqrt(200) and sqrt(1000) are both less than the total number of buffers.

Cost equals 3.(bS + bR), or 3.(200 + 1000) or 3,600.

To know more about Sequential visit:

https://brainly.com/question/28790315

#SPJ4