-- 达梦执行以下参数修改
sp_set_para_value(1, 'VIEW_FILTER_MERGING', 29);
-- 或者在业务sql中使用以下hint:
SELECT /*+VIEW_FILTER_MERGING(29)*/
sel.OWNER,
sel.NAME,
sel.TYPE,
sel.STATUS,
sel.TABLE_NAME
FROM
(
SELECT
a.OWNER,
a.INDEX_NAME AS NAME,
'INDEX' AS TYPE,
obj.STATUS,
a.TABLE_NAME
FROM
ALL_INDEXES a
JOIN
ALL_OBJECTS obj
ON
a.OWNER = obj.OWNER
AND a.TABLE_NAME = obj.OBJECT_NAME
WHERE
a.owner IN ('GDP7SZGCH_LH')
AND obj.OBJECT_TYPE = 'TABLE'
AND a.INDEX_TYPE != 'VIRTUAL'
AND NOT (
(a.TABLE_NAME LIKE 'BM$_%'
OR a.TABLE_NAME LIKE 'BMJ$_%'
OR a.TABLE_NAME LIKE 'MDRT$_%'
OR a.TABLE_NAME LIKE 'MLOG$_%'
OR
a.TABLE_NAME LIKE 'MTAB$_%'
OR a.TABLE_NAME LIKE 'MVIEW$_%'
OR a.TABLE_NAME LIKE 'MTRG$_%'
OR a.TABLE_NAME LIKE 'STAT$_%')
OR
(a.TABLE_NAME LIKE '%$ALOG'
OR a.TABLE_NAME LIKE '%$AUX'
OR a.TABLE_NAME LIKE '%$DAUX'
OR a.TABLE_NAME LIKE '%$RAUX'
OR
a.TABLE_NAME LIKE '%$ROT'
OR a.TABLE_NAME LIKE '%$UAUX')
)) sel
JOIN
ALL_IND_COLUMNS col
ON
sel.OWNER = col.INDEX_OWNER
AND sel.NAME = col.INDEX_NAME
AND sel.TABLE_NAME = col.TABLE_NAME
评论