Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-084 Topic 1 Question 4 Discussion

Actual exam question for Oracle's 1Z0-084 exam
Question #: 4
Topic #: 1
[All 1Z0-084 Questions]

You manage a 19c database with default optimizer settings.

This statement is used extensively as subquery in the application queries:

SELECT city_id FROM sh2.sales WHERE city_id=:Bl

You notice the performance of these queries is often poor and, therefore, execute:

SELECT city_id,COUNT(*) FROM sh2.sales GROUP BY city_id;

Examine the results:

There is no index on the CITY_ID column.

Which two options improve the performance?

Show Suggested Answer Hide Answer
Suggested Answer: A, B

In this scenario, creating an index and generating frequency histograms are two methods that can potentially improve performance:

A (Correct): Generating frequency histograms on the CITY_ID column can help the optimizer make better decisions regarding the execution plan, especially if the data distribution is skewed. Histograms provide the optimizer with more detailed information about the data distribution in a column, which is particularly useful for columns with non-uniform distributions.

B (Correct): Creating an index on the CITY_ID column would speed up queries that filter on this column, especially if it's used frequently in the WHERE clause as a filter. An index would allow for an index range scan instead of a full table scan, reducing the I/O and time needed to execute such queries.

C (Incorrect): While SQL profiles can be used to improve the performance of specific SQL statements, they are usually not the first choice for such a problem, and creating a profile does not replace the need for proper indexing or statistics.

D (Incorrect): Forcing the subquery to use dynamic sampling might not provide a consistent performance benefit, especially if the table statistics are not representative or are outdated. However, dynamic sampling is not as effective as having accurate statistics and a well-chosen index.

E (Incorrect): Adaptive plans can adjust the execution strategy based on the conditions at runtime. While they can be useful in certain scenarios, in this case, creating an index and ensuring accurate statistics would likely provide a more significant performance improvement.


Oracle Database SQL Tuning Guide: Managing Optimizer Statistics

Oracle Database SQL Tuning Guide: Using Indexes and Clusters

Contribute your Thoughts:

Azalee
5 months ago
I think activating adaptive plans could also be beneficial in improving query performance, it's worth considering.
upvoted 0 times
...
Dominga
5 months ago
Using a SQL Profile to enforce the appropriate plan might also be a good option in this situation, instead of just creating an index.
upvoted 0 times
...
Veronika
5 months ago
Generating frequency histograms could also help optimize query performance by providing more information to the optimizer.
upvoted 0 times
...
Gracia
6 months ago
I'm not sure about creating an index. Would generating frequency histograms on the CITY_ID column also be a good option?
upvoted 0 times
...
Azalee
6 months ago
I agree with User1, having an index on the CITY_ID column can speed up queries.
upvoted 0 times
...
Veronika
6 months ago
I think creating an index on the CITY_ID column would help improve the performance.
upvoted 0 times
...
Domingo
6 months ago
That's a good point, Lisha. It could provide more insights for optimization.
upvoted 0 times
...
Lisha
6 months ago
I believe generating frequency histograms on CITY_ID could also be beneficial.
upvoted 0 times
...
Sage
7 months ago
I agree with Domingo, index on CITY_ID would definitely help.
upvoted 0 times
...
Domingo
7 months ago
I think creating an index on the CITY_ID column would improve performance.
upvoted 0 times
...
Dorothea
8 months ago
Ah, I see what you guys are saying. This is a classic case of the 'index or histogram' dilemma. But you know what they say, 'when in doubt, index it out!' *laughs*
upvoted 0 times
Erinn
7 months ago
Yeah, that should definitely improve the performance.
upvoted 0 times
...
Kyoko
7 months ago
Let's create an index on the CITY_ID column.
upvoted 0 times
...
...
Lashaun
8 months ago
I think the first thing we need to do is understand the data distribution. The GROUP BY query shows that the CITY_ID column has a relatively small number of distinct values, so generating a frequency histogram could be a good option.
upvoted 0 times
...
Adria
8 months ago
Hmm, this question seems a bit tricky. We have a 19c database with default optimizer settings, and a subquery that is used extensively in the application. The performance of these queries is often poor, and there is no index on the CITY_ID column.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77