Question: Problem 1 : Indexing ( 4 0 % ) In this task, you will be asked to i ) select suitable indexes to speed up

Problem 1: Indexing (40%)
In this task, you will be asked to i) select suitable indexes to speed up query performance and ii) examine the query plan of an SQL query.
We are going to use a new database called flight attached in A5.zip. In the database, there is a single table, called flights. The following shows its schema:
flights (fid, year, month_id, day_of_month, day_of_week_id, carrier_id, flight_num, origin_city, origin_state, dest_city, dest_state, departure_delay, taxi_out, arrival_delay, canceled,
distance)
Note that this task only needs to use four attributes: carrier_id, origin_city, actual_time, and dest_city.
Follow the steps to create and load the flights database:
with command line:
In your terminal, enter the A5 folder (where the flight_pg.sql locates)
Create a database named flight (createdb -U [your username] flight)
Run command: psql -U [your username]-d flight -f flight_pg.sql
It may take a long time to insert all data.
Problem 1 : Indexing ( 4 0 % ) In this task, you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!