Question

With the help of an example SQL query, explain the different steps that are carried out...

With the help of an example SQL query, explain the different steps that are carried out when cost- based optimization is used by the optimization engine. Cleary state any assumption that you make.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer)

For the cost-based optimization of the query processing below are the components being used:

1) Parser to check for the syntax and semantics analysis

2) An optimizer which would use the costing method, and the cost based optimizer with internal rules, a rule based optimizer for determining the most efficient way of producing the results of the query

3) It also contains the row source generator that receives the optimal plan from that of the optimizer and the outputs for the execution plan for the SQL statement.

4) The SQL execution engine that leads to operations on the plan as executed and associated with the SQL statement which produces the results of the query.

It can be executed as a full table scan or the indexed scanning or the nested scanning or the Hash joins

The steps involved are as follows:

1) Evaluating the expression and the conditions

2) Statement transformation

3) Choosing the optimizer approaches

4) Choosing the access path

5) Choosing the join orders

6) Choosing the join methods

Example:

Use of subqueries in place of Joins are one such example of a query which helps to achieve cost based optimization

If you found the answer useful, hit like
Hope this answer helps.
Thanks

Add a comment
Know the answer?
Add Answer to:
With the help of an example SQL query, explain the different steps that are carried out...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • With the help of an example SQL query, explain the different steps that are carried out when cost...

    With the help of an example SQL query, explain the different steps that are carried out when cost- based optimization is used by the optimization engine. Cleary state any assumption that you make.

  • Q2. a) Explain the penetration test carried out on bitumen, state its significance and draw the...

    Q2. a) Explain the penetration test carried out on bitumen, state its significance and draw the test apparatus. b). Mention the main factors considered in the choice of construction materials at the design office – is any of them more important than the other? c). What factors affect the weldability of steel? d). Consider the iron value chain from material extraction to disposal, at what point according to your assessment is the most energy used? As a design engineer, at...

  • **************PLEASE COMPLETE PART F) ONLY************** Consider the following relational database schema (primary keys are underlined) and...

    **************PLEASE COMPLETE PART F) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...

  • **************PLEASE COMPLETE PART E) ONLY************** Consider the following relational database schema (primary keys are underlined) and...

    **************PLEASE COMPLETE PART E) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...

  • QUESTION: (Answer in SQL) Write an SQL query to find all pairs of users (A,B) such...

    QUESTION: (Answer in SQL) Write an SQL query to find all pairs of users (A,B) such that both A and B have blurted on a common topic but A is not following B. Your query should print the names of A and B in that order. BACKGROUND INFO: Users can post their thoughts in form of short messages that we call “blurts”. When signing up, users need to provide their email and a password of their choice. In addition, they...

  • Cost Behavior Major Concept Assmt #1 Explain and give a unique example the following concepts of...

    Cost Behavior Major Concept Assmt #1 Explain and give a unique example the following concepts of cost behaviors: • Cost drivers Fixed cost and Variable Costs • CVP Analysis Write in complete sentences and pay close attention to grammar Please make sure to clearly explain the concepts as if you were teaching and explaining to another student, that has no background on these concepts. Also, make sure to use a unique example. Take this example from your own situation, either...

  • Project Steps: 1. Database Design 1.1. Design and create a database in third normal form based...

    Project Steps: 1. Database Design 1.1. Design and create a database in third normal form based on the following requirements: • Each Job is for a specific customer and there can be more than one job per customer. • The name and address must be tracked for each customer. • Each job is described by up to 2000 characters. • Each job has a status of ‘open, ‘in process’, or ‘complete’. • Each job has a start date and end...

  • The irreversible elementary gas-phase reaction A + B ) C + D is carried out isothermally...

    The irreversible elementary gas-phase reaction A + B ) C + D is carried out isothermally at 305K in a packed bed reactor with 100 kg catalyst of particle size 8 mm. The entering pressure is 20 atm and the exit pressure is 2 atm. The feed rate is equal molar in A and B and the flow is in the turbulent flow regime, with FA0-10 mol/min and CA 0.4 mol/dm3. Currently 80% conversion is achieved. a) What would be...

  • Cost Behavior Major Concept Assmt #1 Explain and give a unique example the following concepts of...

    Cost Behavior Major Concept Assmt #1 Explain and give a unique example the following concepts of cost behaviors: • Cost drivers • Fixed cost and Variable Costs • CVP Analysis Write in complete sentences and pay close attention to grammar Please make sure to clearly explain the concepts as if you were teaching and explaining to another student, that has no background on these concepts. Also, make sure to use a unique example. Take this example from your own situation,...

  • Top of Form Q1 Which of the following is a valid aggregate function in SQL? Check...

    Top of Form Q1 Which of the following is a valid aggregate function in SQL? Check only those that apply. Question 1 options: AVG LEAST COUNT MIN MOST SUM Q2 Which of the following aggregate functions will only operate on a numeric value expression? Check only those that apply: Question 2 options: MIN MAX AVG COUNT SUM Q3 When applying DISTINCT to the value being calculated in an aggregate function like COUNT, what is the effect? SELECT COUNT(DISTINCT StreetName) FROM...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT