Skip to Main Content
  • Questions
  • Regarding the Oracle SQL Tuning Report

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, pks.

Asked: June 30, 2016 - 4:08 am UTC

Last updated: July 03, 2016 - 2:59 am UTC

Version: 11.1.0.7.0

Viewed 1000+ times

You Asked

Team,
I recently had one issue with one of my production database where we had an application upgrade completed. Once the upgrade completed , one of the select query stared performing very slow. I have tried debugging using the sqltrpt.sql , but this never gave me a proper fix for the issue, this tuning advisor was basically giving me suggestions on creating new indexes and rewrite the predicate.
I tried with these findings and it didn’t give me any improvement in the query in fact taking more time.

Later I see a difference in size for the schema after upgrade and I went with a table reorg. This improves the performance and my query ran in 30 sec from 48 minutes.

Does this SQL tuning advisor taking this defragmented tables in consideration and suggest for a reorg of the table?


1- Index Finding (see explain plans section below)
--------------------------------------------------

The execution plan of this statement can be improved by creating one or more
indices.

Recommendation (estimated benefit: 88.36%)
------------------------------------------
- Consider running the Access Advisor to improve the physical schema design
or creating the recommended index.
create index owner.indexname on
owner.table_name("col1","col2");

Rationale
---------
Creating the recommended indices significantly improves the execution plan
of this statement. However, it might be preferable to run "Access Advisor"
using a representative SQL workload as opposed to a single statement. This
will allow to get comprehensive index recommendations which takes into
account index maintenance overhead and additional space consumption.

2- Restructure SQL finding (see plan 1 in explain plans section)
----------------------------------------------------------------
Predicate "TBL_name"."Col"<>:B1 used at line ID 19
of the execution plan is an inequality condition on indexed column
"COl". This inequality condition prevents the optimizer from
selecting indices on table "owner".table_name

Recommendation
--------------
- Rewrite the predicate into an equivalent form to take advantage of
indices.

Rationale
---------
The optimizer is unable to use an index if the predicate is an inequality
condition or if there is an expression or an implicit data type conversion
on the indexed column.

Thanks
pksadoor

and Connor said...

According to the documentation

https://docs.oracle.com/database/121/TGSQL/tgsql_sqltune.htm#TGSQL542

"Tuning recommendations include:
- Collection of object statistics
- Creation of indexes
- Rewriting SQL statements
- Creation of SQL profiles
- Creation of SQL plan baselines"

so reorgs it would appear are not considered.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Regarding the Oracle SQL Tuning Report

pks, July 01, 2016 - 4:20 am UTC

Connor,
Thanks for the quick response..
I feel Oracle should consider this also as this will save a lot of time while we are doing some performance analysis. Do we have any other tuning advisor which shows this other than sqltrpt, which table is fragmented and need a reorg or in some cases the rebuild index after a direct path insert ?

Thanks
Pksadoor
Connor McDonald
July 03, 2016 - 2:59 am UTC

Maybe check out what the segment advisor has to offer

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.