Three-schema architecture (external, conceptual, internal) in DBMS Theory - Time & Space Complexity
We want to understand how the time to access or manage data grows in the three-schema architecture.
How does the system handle requests as data and user views increase?
Analyze the time complexity of accessing data through the three-schema layers.
-- Pseudocode for data retrieval in three-schema architecture
SELECT * FROM External_View
WHERE condition;
-- External view maps to conceptual schema
-- Conceptual schema maps to internal storage
-- Data fetched from internal storage
This shows a user query on an external view that the system translates through conceptual and internal layers to get data.
Look at the main repeated steps in data access.
- Primary operation: Data lookup and translation through schemas.
- How many times: Once per query, but may involve scanning data records depending on conditions.
As data size grows, the time to find matching records grows roughly in proportion.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 lookups |
| 100 | 100 lookups |
| 1000 | 1000 lookups |
Pattern observation: The time grows linearly as the number of data records increases.
Time Complexity: O(n)
This means the time to access data grows roughly in direct proportion to the number of records.
[X] Wrong: "The three-schema layers make data access instant regardless of data size."
[OK] Correct: The layers organize data and views but do not reduce the time needed to search through data records.
Understanding how data access time grows with data size in layered architectures shows your grasp of database design and performance.
"What if the internal schema used an index? How would the time complexity change?"