Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions 3 - 5 For each SQL query below, do the following: a ) Write a query for the pg class table to get the

Questions 3-5
For each SQL query below, do the following:
a) Write a query for the pg class table to get the number of pages and tuples in each
relation. Show the query and the results. No need to repeat answers if a table is used
multiple times in the questions below. That is, for each question, just get information
about "new" tables.
b) List two types of join algorithms that could be used for the query.
c) Using the formulas provided in the slides, calculate the cost of doing each type of
join listed in b. Note: Keep in mind number of scans is a number of times of
scanning; therefore, it needs to be in integer.
d) Use EXPLAIN to identify which join algorithm PostgreSQL uses.
e) Report if your calculation of which join is cheapest matches PostgreSQL's choice or
not
8)
Use work mem /8k to find # of buffer pages available to join (Documentation:
Resource Consumption)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

what is hardware system in distributive enterprise system?

Answered: 1 week ago

Question

2. What are the components of IT infrastructure?

Answered: 1 week ago