Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: For All Entries - Performance Issue

$
0
0

Hi Swetha,

 

1). If possible dn't use into corresponding fields because it takes too much time.

 

2.) Avoid selecting * if all fields are not required.

 

3.)Instead of using nested Select loops or FOR ALL ENTRIES it is often possible to use subqueries.

Network load is considerably less.

 

For example:

SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA

                                    WHERE SEATSOCC < F~SEATSMAX

                                     AND EXISTS ( SELECT * FROM SPFLI

                                    WHERE CARRID = F~CARRID

                                     AND CONNID = F~CONNID

                                     AND CITYFROM = 'FRANKFURT'

                                    AND CITYTO = 'NEW YORK' )

                                    AND FLDATE BETWEEN '19990101' AND '19990331'.

                                   ENDSELECT.

 

Instead of

 

SELECT * FROM SPFLI

                                    INTO TABLE T_SPFLI

                                    WHERE CITYFROM = 'FRANKFURT'

                                    AND CITYTO = 'NEW YORK'.


SELECT * FROM SFLIGHT AS F

                                    INTO SFLIGHT_WA

                                    FOR ALL ENTRIES IN T_SPFLI

                                    WHERE SEATSOCC < F~SEATSMAX

                                    AND CARRID = T_SPFLI-CARRID

                                    AND CONNID = T_SPFLI-CONNID

                                    AND FLDATE BETWEEN '19990101' AND '19990331'.

                                   ENDSELECT.

4.) Sort the comparision field in the driver table.

5.) Delete the adjacent duplicates from the driver table , it will enhance the performance time of the program.

6.) Check if the driver table is not initial.


Regards.

Dhananjay Choubey


Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>