Question: There are six queries here for the DELLSTORE database, each involving a join involving some or all of the tables customers orders (invoices) orderlines (invoice_items)
There are six queries here for the DELLSTORE database, each involving a join involving some or all of the tables customers orders (invoices) orderlines (invoice_items) products (parts) Information on the DELLSTORE database is below. You can enable a more vertical output format with the psql command \x on if you wish. For each of the queries below, 1-6, you should do the following regarding the Postgres query plan: Give me the Postgres explain output that you get from your machine Interpret this output to give me the exact join order (which may be a tree structure): What is the first pair of tables joined? What is the algorithm? What is the order of each subsequent join? Answer the additional questions 2-6 (there is no additional question for join 1)
3. Range match on orderlines.prod_id (there is NOT an index on this attribute) explain select c.lastname from customers c join orders o on c.customerid = o.customerid join orderlines ol on o.orderid = ol.orderid where ol.prod_id <= 5;
Question 3: Does adding an index on orderlines.prod_id affect the join? If so, how? Create the index with create index orderprodex on orderlines(prod_id); Delete the index later with drop index orderprodex;
http://pld.cs.luc.edu/courses/305/spr16/dellexplain.html
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
