COMP3311 Final Exam 21T3 |
The University of New South Wales COMP3311 Database Systems Final Exam 21T3 |
Database Systems |
Explain each of the following observations in 2-4 sentences.
Consider the execution times of the following queries:
mymyunsw=# select fullname from people where id=9300035; fullname --------------- John Shepherd (1 row) Time: 1.242 ms mymyunsw=# select fullname from people where id=9300035; fullname --------------- John Shepherd (1 row) Time: 0.284 ms
Subsequent execution times for the same query are all around 0.28 ms. Why is the first execution so much slower? Assume that the database server started just before the first query.
Consider the execution times of the following two queries:
mymyunsw=# select max(id) from people; max --------- 5235067 (1 row) Time: 0.291 ms |
mymyunsw=# select max(birthday) from people; max ------------ 2000-12-30 (1 row) Time: 0.891 ms |
Subsequent executions of the queries have similar timing. Why is the first query faster than the second?
Instructions: