Ask the Expert

Query performance degraded after updating statistics

We recently updated statistics on a schema in Oracle 9i. The performance on some queries has degraded significantly. One query in particular has gone from approx. 30 msecs to 20 seconds. Any ideas?

    Requires Free Membership to View

You should trace the queries and see what path the optimizer is taking. You also might consider investigating data skew as a source of the problem; if data is very unevenly distributed in a column, the optimizer might be making a bad choice. Consider the use of optimizer histograms if data skew is present.

Whenever you're planning to upgrade statistics, it's a good idea to use DBMS_STATS to save the existing statistics off to another table. You can then switch between the two sets, trace SQL with each, and see exactly how the optimizer's plan has changed.

This was first published in May 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: