Skip to main content

Posts

Showing posts from June, 2021

Test case of how to sql_id#2 use the good plan of sql_id#1 using sql plan baseline

I have a copy of sql text taken from a sql_id#1, but when manually run this query, it generates new sql_id#2, and different query plan, unfortunately a very slow performed plan.  ###how do I use sql plan baseline to guide the sql_id#2 use the good plan of sql_id#1? ###Tom has this doc: let me try it: https://asktom.oracle.com/pls/apex/f?p=100:11:::::P11_QUESTION_ID:9541780100346252065 ### this is very useful to explain sql_handle, sql_id and signature etc. https://www.lab128.com/all_these_oracle_ids/article_text_sql_ids/ ###how to force slightly modified sql query to use good query plan ###I have a sql plan baseline already for sql_id#1, EXACT_MATCHING_SIGNATURE='16767805607617541771' SQL_PLAN_fjctqbj4djdnbb90e17cc for plan_hash_value=857947328 ( a good plan) > @sqlid_cursor select PARSING_SCHEMA_NAME  as schema,child_number as chld#, executions as exec#, buffer_gets,  is_bind_sensitive, is_bind_aware,IS_SHAREABLE,hash_value,plan_hash_value,    first_load_time,LAST_ACTIVE_TI