Why the relational model dominates databases in DBMS Theory - Performance Analysis
We want to understand how the relational model handles data operations as the amount of data grows.
How does the time to perform common tasks change when the database gets bigger?
Analyze the time complexity of a simple SQL query on a relational database.
SELECT * FROM Employees WHERE Department = 'Sales';
This query retrieves all employees who work in the Sales department from a table.
Look at what the database does to find matching rows.
- Primary operation: Scanning rows to check the Department value.
- How many times: Once for each row in the Employees table.
As the number of employees grows, the database checks more rows.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 checks |
| 100 | 100 checks |
| 1000 | 1000 checks |
Pattern observation: The work grows directly with the number of rows.
Time Complexity: O(n)
This means the time to find matching rows grows in a straight line as the table gets bigger.
[X] Wrong: "The database instantly finds the rows no matter how big the table is."
[OK] Correct: Without special help like indexes, the database must check each row one by one, so bigger tables take more time.
Understanding how queries scale with data size shows you know what affects database speed and helps you design better systems.
"What if we added an index on the Department column? How would the time complexity change?"