Concept:
File organization determines how records are physically mapped onto the disk. The simplest form is the Heap File Organization. In this method, the database simply places a new record in the first available free space it finds.
Step 1: Structure of a Heap File.
There is no ordering based on a key (like ID or Name). Records are appended to the end of the file or inserted into gaps left by deleted records. There is no sorting and no extra structure like an index.
Step 2: Performance Analysis (Search).
Because the records are unsorted, if you want to find a specific record (e.g., "Find Student where ID = 50"), the database has no way of knowing where it is. It must start at the very first block and check every single record until it finds the match or reaches the end of the file.
\[ \text{Search Time (Linear Scan)} = O(N) \]
Step 3: Pros and Cons.
• Pros: Insertion is extremely fast ($O(1)$) because you just "dump" the data at the end. It is useful for bulk loading data.
• Cons: Retrieval is very slow. It is almost never used for large production tables without an additional indexing layer.