Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
In the world of database administration, performance issues can appear unexpectedly, impacting critical routines and frustrating end-users. Recently, I encountered a performance issue where a routine was running slowly. After analyzing and tracing the session, I successfully optimized the query execution by applying a SQL Profile with a more efficient execution plan. Here’s how it went.
fvckht837rq3q
).@x
script, I analyzed the execution plan to check for any missing indexes or high-cost operations. I found that the query was running without any index-related issues, so I proceeded to investigate if other execution plans could offer better performance.@coe2
script, specifying the SQL ID fvckht837rq3q
and Child Number 2. This script listed all available plans in AWR for this query, along with their average execution times. Here’s an example of the output I received: AVG_ET_SECS_MEM | AVG_ET_SECS_AWR | PLAN_HASH_VALUE | EXECUTIONS_MEM | EXECUTIONS_AWR
--------------- | --------------- | --------------- | -------------- | --------------
0.111595 | 836027571 | 2
0.117445 | 777303881 | 16 | 1
8.413716 | 413235616 | 6 | 5
254.156695 | 807204715 | 13 | -
378.836647 | 1200825706 | 4 |
Among the plans, I identified one with a significantly lower average execution time of 0.111 seconds, associated with the Plan Hash Value 836027571
.
@coe2
script, I generated a SQL Profile for the optimal Plan Hash Value. This created a file named coe_xfr_sql_profile_fvckht837rq3q_836027571.sql
. I executed this script, applying the SQL Profile to enforce the more efficient plan.This experience highlights the power of SQL Profiles in Oracle Database for improving query performance without changing the SQL code. By enforcing a more efficient execution plan, we can address performance issues in production without interrupting ongoing operations.