SF_INJECT_HINT函数来绑定SQL语句使其使用对应的HINT

SF_INJECT_HINT('(locationcode, servicecode, ytenant_id) IN','ENABLE_IN_VALUE_LIST_OPT(519)','多语多值IN-1','多语多值IN慢的问题',TRUE,TRUE);
SF_INJECT_HINT('(locationcode, langcode, ytenant_id) IN','ENABLE_IN_VALUE_LIST_OPT(519)','多语多值IN-2','多语多值IN慢的问题',TRUE,TRUE);

sf_inject_hint(
sql_text => 'from dmhr.employee a, dmhr.department b where a.department_id = b.department_id;',
hint_text =>'use_nl(a,b)',
name =>'TESTSQL',
description => 'this is a test hint',
validate => true);

--hint设置查看

select NAME, DESCRIPTION, VALIDATE, SQL_TEXT, HINT_TEXT, CREATOR, CRTDATE from SYSINJECTHINT;

--查看hint使用情况

select * from SYS.V$INJECT_HINT_INFO

--状态修改
SF_ALTER_HINT('TESTJOIN' ,'STATUS', 'DISABLED');

--hint删除
sf_deinject_hint('TESTJOIN');

posted @ 2025-04-14 10:18  刚好遇见Mysql  阅读(49)  评论(0)    收藏  举报