0
0
DBMS Theoryknowledge~5 mins

Three-schema architecture (external, conceptual, internal) in DBMS Theory - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Three-schema architecture (external, conceptual, internal)
O(n)
Understanding Time 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?

Scenario Under Consideration

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.

Identify Repeating Operations

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.
How Execution Grows With Input

As data size grows, the time to find matching records grows roughly in proportion.

Input Size (n)Approx. Operations
1010 lookups
100100 lookups
10001000 lookups

Pattern observation: The time grows linearly as the number of data records increases.

Final Time Complexity

Time Complexity: O(n)

This means the time to access data grows roughly in direct proportion to the number of records.

Common Mistake

[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.

Interview Connect

Understanding how data access time grows with data size in layered architectures shows your grasp of database design and performance.

Self-Check

"What if the internal schema used an index? How would the time complexity change?"