|
-
After I added the index hint and the execution plan doesn't have any full table scan, however the query run much slower ( from 390 msec to 56 sec).
SELECT /*+ INDEX(S SUPPLIER_PK) */ S.SUPPLIER_ID AS "SUPPLIER_ID"
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 /*+ INDEX(SSA SUPPLIER_SPM_ACL_PK) */ 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|