Database-Management-System
August 29, 2024Transactions
August 29, 2024Database-Management-System
Question 539 |
Read_item(X) | |
Write_item(X) | |
Both (A) and (B) | |
None of these |
1. read_item(X): Reads a database item named X into a program_variable. To simplify our notation, we assume that the program variable is also named X, i.e X=r(x)
steps:
1. Find the address of the disk block that contains item X.
2. Copy that disk block into a buffer in main memory (if that disk block is not already in some main memory buffer).
3. Copy item X from the buffer to the program variable named X.
2. write_item(X): Writes the value of program variable X into the database item named X.
steps:
1. Find the address of the disk block that contains item X.
2. Copy that disk block into a buffer in main memory (if that disk block is not already in some main memory buffer).
3. Copy item X from the program variable named X into its correct location in the buffer.
4. Store the updated block from the buffer back to disk (either immediately or at some later point in time).
1. read_item(X): Reads a database item named X into a program_variable. To simplify our notation, we assume that the program variable is also named X, i.e X=r(x)
steps:
1. Find the address of the disk block that contains item X.
2. Copy that disk block into a buffer in main memory (if that disk block is not already in some main memory buffer).
3. Copy item X from the buffer to the program variable named X.
2. write_item(X): Writes the value of program variable X into the database item named X.
steps:
1. Find the address of the disk block that contains item X.
2. Copy that disk block into a buffer in main memory (if that disk block is not already in some main memory buffer).
3. Copy item X from the program variable named X into its correct location in the buffer.
4. Store the updated block from the buffer back to disk (either immediately or at some later point in time).