I don't see how forcing the index with a hint would improve the performance if the CBO determined a FTS to be more efficient from the get go.
Perhaps if you explained what each query is trying to accomplish.
Is there any reason an OR statement in the where-clause could not
accomplish what you need?
Does this improve anything?
PHP Code:select decode(a, null, b, a) supplier_id from
(SELECT s.supplier_id a
FROM company_default_permissions cdp, username u, supplier s
WHERE u.username_id = 117120
AND u.company_id = cdp.company_id
AND u.company_id = s.company_id
AND s.supplier_id NOT IN (
SELECT supplier_id
FROM supplier_spm_acl ssa
WHERE ssa.supplier_id = s.supplier_id
AND ( ssa.username_id = 117120
OR ssa.user_group_id IN (
SELECT user_group_id FROM username_group_map
WHERE username_id = 117120)))
AND cdp.can_read = 1
AND cdp.object_type_id = 9)
full outer join
(SELECT s.supplier_id b
FROM supplier_spm_acl ssa, username u, supplier s
WHERE u.username_id = 117120
AND u.username_id = ssa.username_id
AND u.company_id = s.company_id
AND s.supplier_id = ssa.supplier_id
AND ssa.can_read = 1)
on a = b




Reply With Quote