File Org & Indexing - DPP 03 (Of Lec 06) 2
File Org & Indexing - DPP 03 (Of Lec 06) 2
[MCQ] [NAT]
1. The order of a leaf node in a B+ tree is the maximum 6. The order of a node in B tree is the maximum number
number of (value, data record pointer) pairs it can hold. of block pointers it can hold. Given that the block size
Given that the block size is 1K bytes, data record
is 2K bytes, data record pointer is 8 bytes long, the
pointer is 8 bytes long, the value field is 10 bytes long
and a block pointer is 6 bytes, then what is the order of search key is 9 bytes long and a block pointer is 5 bytes
the leaf node? long. The best possible order of B tree node is .
(a) 53 (b) 54
(c) 55 (d) 56 [NAT]
7. The order of a leaf node (P) in a B+ tree is the maximum
[NAT]
number of (value, data record pointer) pairs it can hold.
2. The order of a node in B+ tree is defined as the number
of pointers it can hold. What is the maximum number Given that P=36, data record pointer is 8 bytes long,
of keys that a B+ tree of order 4 and height 4 can have the search field is 6 bytes long and a block pointer is 8
? __________ bytes long. The permissible block size is .
(Assume that the height of a root node is 1)
[NAT]
[MCQ]
3. Given a block can hold either 3 records or 10 key 8. (Assume that the level of root node is1)
pointers. A database contains P records, then how The order of different nodes in B+ tree/B tree are given
many blocks do we need to hold the data file and the as-
dense index? 2 to P block pointers in root node.
P P P
(a) (b)
30 3 2 to P block pointers in internal node.
13P P
(c) (d) P
30 10 2 –1 to (P–1) keys in leaf node.
[NAT] [MSQ]
10. Consider the keys (1– 5000) are going to be interested 12. Which of the following is/are true reading B+ tree?
(a) Records can be fetched in equal number of disk
into a B+ tree. Assume, all the order are available
access.
before insertion. The orders P for B+ tree node is (b) Height of the tree remains balanced and less as
defined as- compared to B tree.
2 to P pointer for root (c) Keys are used for indexing
P (d) Faster search queries as the data is stored only on
2 to P pointer for another node. the leaf nodes.
The maximum possible levels in a B+ tree index for P [NAT]
= 9 is _________. 13. Consider the keys (1– 5000) are going to be interested
(Assume that level of the root node is 1) into a B+ tree. Assume, all the order are available
before insertion. The orders P for B+ tree node is
[MCQ] defined as-
11. Consider the following statements: 2 to P pointer for root
S1: In a B+ tree, data pointers are stored only at the leaf
nodes of the tree. P
2 to P pointer for another node.
S2: The leaf node has an entry for every value of the
search field, along with the data pointer to the The minimum possible levels in a B+ tree index for P =
record. 9 is _________.
Choose the correct statements. (Assume that level of the root node is 1)
(a) Only S1 is true
(b) Only S2 is true
(c) Both S1 and S2 are true
(d) Neither S1 nor S2 is true
3
Answer Key
1. (d) 8. (269)
2. (255) 9. (5624)
3. (c) 10. (6)
4. (52) 11. (c)
5. (c) 12. (a, b, c, d)
6. (93) 13. (4)
7. (512)
4
[NAT] [MCQ]
6. Consider a database of fixed-length records stored as 7. Consider the following statements-
an ordered file. The database has 25,000 records with S1: If the records of a relation X are physically
each records being 100 bytes, of which the non-key ordered over a non-key field P and an index is
attribute on which clustering index is formed occupies build over the key-field of relation X, then the
10 bytes. The data file is completely block aligned. index is necessarily a secondary index over key
Suppose, block size, of the file system is 512 bytes attribute.
and a pointer to the block occupy 5 bytes. You may S2: More than one secondary indexes are possible.
assume that a binary search on an index file of b
block may take log2b accesses in worst case. Which of the given statement(s) is/are CORRECT?
Given that a cluster consumes 2 blocks, the number of (a) S1 only
block accesses required to identify the desired data in (b) S2 only
the worst case is ______. (c) Both S1 and S2
(d) Neither S1 nor S2
3
Answer Key
1. (b) 5. (b)
2. (4096) 6. (9)
3. (b) 7. (c)
4. (b)
4
(b) A data structure that allows for fast searching and (d) None of the above.
retrieval of data, based on certain criteria.
(c) A set of constraints that enforce rules for data
integrity
3
Answer Key
1. (64) 6. (d)
2. (61500) 7. (b)
3. (d) 8. (c)
4. (41) 9. (b)
5. (21)
4