Question: Write the 5 different queries from the same tables and rows. This can use different indexes, joins, aggregates, merges, parallel/serial, etc. Then force a better
Write the 5 different queries from the same tables and rows. This can use different indexes, joins, aggregates, merges, parallel/serial, etc. Then force a better query plan using hints
Here are the instructions:
-Create a database with some tables, insert some rows, and select 5 different queries.
-Save screenshots of the query plans generated by the optimizer for all 5 different queries.
-Run the queries and record the execution time.
-Add hints to the queries, and take screenshots of the new query plans.
-Run the queries with hints, and record the execution time.
-Show the impact of your hint by displaying the performance improvement. It can be calculated using the below formula:
-Percent Improvement = 100 * ( 1 - (optimized time / original time) )
-The bigger the improvement, the better.
-Tell us why the initial query plan was chosen by the query optimizer and what improvements you made, and the rationale behind your choices
Step by Step Solution
3.38 Rating (160 Votes )
There are 3 Steps involved in it
Sure here is an example of 5 different queries on the same tables and rows using different indexes joins aggregates merges parallelserial and forcing ... View full answer
Get step-by-step solutions from verified subject matter experts
