Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Avoid Full Table scan

Orcl ApexNov 23 2017 — edited Jan 18 2018

Hi All,

I have below query and it's cost is high because of Full table scan, is there any way to avoid full table scan to improve performance.

SELECT CASE

                 WHEN COUNT(1)>0 THEN 'Y' 

                 ELSE 'N'                                                                                                                                                                           

                 END "reprint\_flag" 

             FROM wms\_label\_requests\_hist wlrh 

             , wms\_label\_requests wlr 

             ,fnd\_lookup\_values flv 

             ,wms\_label\_formats wlf                                                                                                                                                                 

             WHERE wlf.label\_format\_id= wlr.label\_format\_id 

            AND wlrh.lpn\_id=wlr.lpn\_id 

              AND wlrh.organization\_id=wlr.organization\_id 

              AND wlf.label\_format\_name=flv.meaning 

             AND flv.lookup\_type = '322\_CONSTANTS'                                                                                                                                          

              AND flv.lookup\_code = 'FORMAT' 

             AND TRUNC(wlrh.creation\_date)=TRUNC(SYSDATE) AND 

         WLR.LABEL\_REQUEST\_ID = :REQUEST\_ID

pastedImage_3.png

This post has been answered by Paulzip on Nov 23 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2017
Added on Nov 23 2017
28 comments
1,369 views