Hi,
Whenever you choose execution type (dynamic or static) on a lower value it is basically “dynamic”.
Because it generates hint by which you lately make some statistic analyses for each execution. Here is brief case of mine words (taken while SQL Optimizer was executing):
SQL>@sql_id 1 72w638vps8zs1
SQL_FULLTEXT
select /+ Set 40_00000000624533 / NVL(TOTAL_POINTS_BALANCE, 0)
from CLUB_BILL_SUBSCRIBER
where MEMBER_ID = :b1
and CLUB_CODE = :b2
and BAN = :b3
and SUBSCRIBER_NO = :b4
and BEN = :b5
and BILL_SEQ_NO = (select /+ USE_MERGE(B,CBS) */ max(CBS.BILL_SEQ_NO)
from CLUB_BILL_SUBSCRIBER CBS,
BILL B
where CBS.MEMBER_ID = :b1
and CBS.CLUB_CODE = :b2
and CBS.BAN = :b3
and CBS.SUBSCRIBER_NO = :b4
and CBS.BEN = :b5
and CBS.BAN = B.BAN
and CBS.BILL_SEQ_NO = B.BILL_SEQ_NO
and CBS.BEN = B.BEN
and B.CLUB_CALCULATION_STATUS = ‘S’)
Current sessions run that sql
no rows selected
gv$sql data …
IID CH PLAN_HASH_V EXECS TIME [s] ROWS AVG TIME [s] AVG ROWS AVG LIO AVG CPU [s] LAST_LOAD LAST_ACTIVE SH SQL_PROFILE BA BS
1 0 2570093969 1 0.96700 1 0.96656 1.000 258.00000 0.0030000 06-23/14:59:19 06-23/14:59:20 Y N N
@sql_id [inst_id] [sql_id]
SQL>@sql_id 1 7pfurkfvyytrj
SQL_FULLTEXT
select /+ Set 43_00000000624610 / NVL(TOTAL_POINTS_BALANCE, 0)
from CLUB_BILL_SUBSCRIBER
where MEMBER_ID = :b1
and CLUB_CODE = :b2
and BAN = :b3
and SUBSCRIBER_NO = :b4
and BEN = :b5
and BILL_SEQ_NO = (select /+ USE_MERGE(B,CBS) */ max(CBS.BILL_SEQ_NO)
from CLUB_BILL_SUBSCRIBER CBS,
BILL B
where CBS.MEMBER_ID = :b1
and CBS.CLUB_CODE = :b2
and CBS.BAN = :b3
and CBS.SUBSCRIBER_NO = :b4
and CBS.BEN = :b5
and CBS.BAN = B.BAN
and CBS.BILL_SEQ_NO = B.BILL_SEQ_NO
and CBS.BEN = B.BEN
and B.CLUB_CALCULATION_STATUS = ‘S’)
Current sessions run that sql
no rows selected
gv$sql data …
IID CH PLAN_HASH_V EXECS TIME [s] ROWS AVG TIME [s] AVG ROWS AVG LIO AVG CPU [s] LAST_LOAD LAST_ACTIVE SH SQL_PROFILE BA BS
1 0 2570093969 1 1.56600 1 1.56574 1.000 360.00000 0.0040000 06-23/14:59:26 06-23/14:59:27 Y N N
@sql_id [inst_id] [sql_id]
SQL>
Mine question is to introduce “full static on server” execution type, which could be used ONLY in bind sets execution. This would mean to leave query as it is and just change binds sets in execution and make one sql calculation
Why?
In this case 100 of executions will have the one entry in gv$sql, this would be easy to find in ASH, AWR or parallel monitoring and on the end will be really summary for binds set use-like it is in real life-one sql_id for all executions.
Once again, stat for such a query would be only possible in binds set usage, will not have stat for each execution but for summary only.
Is that possible?
Thx
Damir