Passenger (pid, pbithday, pcity) Station (sid, sname, sxcoord, sycoord)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Passenger (pid, pbithday, pcity)
Station (sid, sname, sxcoord, sycoord)
CheckIn (pid, departure_sid, arrive_sid, departure_date, arrive_date)
departure_sid reference sid in Station
arrive_sid reference sid in Station
pid references pid in Passenger


there are 400 million Passenger, 500 stations, and 20 billion checkIn stored in the schema. For simplicity, assume that every attribute is of size 8 bytes, and the size of each tuple is thus 8*x bytes for a table with x attributes, and that the size of a table is simply the size of a tuple multiplied by the number of tuples (i.e., 100% occupancy and no gaps or space for block metadata). Now consider the following queries:


SELECT P.pid
FROM Passenger p, CheckIn C, Station S
WHERE P.pid = C.pid
and C.departure_sid = S.sid
and S.sname = "LA"
and year(P.pbithday) = 2000
and date(C.departure_date) = "2015-12-12"

question:
1. first join P with C, and then join result with S
2. first join S with C, and then join result with P
Which way would be faster for this query,
or would it not make much of a difference in this case? and explain way.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY