File Organization and Indexing - DPP 01 Discussion Notes
File Organization and Indexing - DPP 01 Discussion Notes
ENGINEERING
Database
Management System
File Organization and Indexing
File Org & Indexing
C 9 D 10
[NAT]
#Q. Assume a relational database system that holds relation: Product (P) with
the following characteristics
∙ Records are stored as fixed length, fixed format records, with the length of
256 bytes.
∙ There are 262144 records.
∙ Records contain attribute P.I (The identifier of the product involved), with
the length 24 bytes, and an attribute P.C (the cost of product), with the
length 32 bytes and other fields.
∙ Unspanned organization is used to store the record.
Assume that we want to build a dense secondary index on P.C, then how many
numbers of 4096-byte blocks needed to store the dense secondary index. When
record pointer size is 32 bytes? _______.
[MCQ]
#Q. Consider a SQL statement SELECT P1, P2, P3 from Q WHERE P2 = ‘Pavan’ is
frequently executed, which column(s) should be considered for indexing
based only on the statement itself?
A P1 only
B P2 only
C P3 only
D P1, P2 and P3
[MCQ]
#Q. Consider the following specification of system-Disk block size = 2048 bytes
Block pointer size = 16 bytes
Record pointer size = 20 bytes long file contains 30,000 records.
Each record of the file has the following fields:
An extra/additional byte is used per record to represent end of the record.
What is the block factor of the database file assuming unspanned file
organization?
Fields Size (in Bytes)
A 16
EmpName 5
EmpNum 10
B 32 DeptNum 9
Addr 20
PhNum 9
C 48
DOB 1
Sex 1
Job 3
D 64
Sal 5
[MSQ]
#Q. Which one of the following statements is/are True regarding indexing?
B A database file can consist of at most one clustered index with multiple
secondary indexes.
C A database file can consist of multiple primary indexes.
A S1 only B S2 only
#Q. The order of a leaf node in a B+ tree is the maximum number of (value, data
record pointer) pairs it can hold. Given that the block size is 1K bytes, data
record 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 the leaf node ?
A 53 B 54
C 55 D 56
[NAT]
#Q. The order of an internal node in B+ tree index is the maximum number of
children it can have. Assume that a child pointer takes 6 bytes, the search
field value takes 34 bytes and the blocks size is 2048 bytes. The order of the
internal node is ________.
[MCQ]
#Q. Given a block can hold either 3 records or 10 key pointers. A database
contains P records, then how many blocks do we need to hold the data file
and the dense index ?
A B
C D
[MCQ]
#Q. Assume a disk with block size B = 1024 Bytes, A block pointer is PB = 12
bytes long and a record pointer is PR = 18 bytes long. A file has 1,00,000
patients records of size 100 bytes. Suppose the file is ordered by the key
field PID and we want to construct a secondary (dense) index on non-key
field Dept ID (14 bytes), then minimum of how many blocks are required to
store index file assuming an unspanned organization?
A 3000 B 3100
#Q. The order of a node in B tree is the maximum number of block pointers it
can hold. Given that the block size is 2K bytes, data record pointer is 8 bytes
long, the search key is 9 bytes long and a block pointer is 5 bytes long. The
best possible order of B tree node is .
[NAT]
[MCQ]
D Faster search queries as the data is stored only on the leaf nodes.
[NAT]
#Q. Consider the following specification of system with disk block size 2048
bytes, block pointer size 14 bytes, record pointer size 18 bytes long and file
size 60,000 records. Each record of file is 256 bytes long and record of the
size is sorted on the key field. If the primary index (sparse) is built on the
kye field (ESN) which is 18 bytes long. What is the Index blocking factors
(That is number of indexes per block)
Assuming unspanned file organization _________.
[NAT]
A 1800 B 1825
C 1850 D 1857
[MCQ]
#Q. Consider an unordered file of 106 records with records size of 200 bytes
stored on blocks of 8KB with a spanned records organization. We will
assume that no system related information is stored within a block, then
how many blocks would it be need to store this file?
A 24400 B 24405
C 24410 D 24415
[MCQ]
A Only S1 correct
B Only S2 correct