Question: Hi, I have a question about databases and forcing a better choice after the query optimizer choose a plan. I need 5 different queries from
Hi, I have a question about databases and forcing a better choice after the query optimizer choose a plan.
I need 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
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
