Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Performace on select query. Open cursor vs all entries

Former Member
0 Kudos

HI Experts,

I have a performance issue on the selecting the huge number of records in the RESB table with all entries, hence I am trying to fine tune the code as shown below in 2 ways.

1. I tried the Open cursor method to select the records and I checked with the get run time statement,however there is no much performance improvement and could not see any consistent performnace

2. The second option was to eliminate the duplicate entries in the table which I used in the for all entries, This also not made much difference in the performace.

note that the where clause used in the select query is also a key field in the table.

I am looking for some alternate solution for the above issue. Please let me know how to take care the performnace issue when we hit the big tables.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Sai, I think you covered all the points of performance tunning, I like to see your select query.

Thanks,

Anmol.

Former Member
0 Kudos

Open cursor is not an option, IMHO....might be nice if you needed to process every row in an entire table.

What's the WHERE clause look like? does it have an equal condition for every field in the RESB primary key? If it does, that's as fast as you're going to get, probably, unless there are also other fields named with performance-killers like NOT operators or IS INITIAL or something like that.

What does ST05 show for access?

former_member235395
Contributor
0 Kudos

Sai Sai,

Your need review your performance. It's recommended use SLIN Tcode, performance too, use of Sorted o Hashed Internal Tables, use of index, populate the table using INTO TABLE statement after of select and NOT INTO CORRESPONDING FIELDS

For Example

TYPES: BEGIN OF ty_resb,

rsnum TYPE resb-rsnum,

rspos TYPE resb-rspos,

rsart TYPE resb-rsart,

END OF ty_resb.

DATA gti_resb TYPE SORTED TABLE OF ty_resb WITH NON-UNIQUE KEY rsnum rspos rsart. SORTED TABLE

START-OF-SELECTION.

select rsnum rspos rsart

INTO TABLE gti_resb USE INTO TABLE for populate the INTERNAL TABLE

FROM resb

WHERE rsnum = '000000009'

%_HINTS MSSQLNT 'index("RESB~0")'. RESB INDEX

Remember that, when you use INTENAL TABLE, if you use an LOOP ITAB sentences, is better that ITAB was declared like SORTED TABLE and if you use READ TABLE ITAB, is better that ITAB was declared like HASHED TABLE.

Regards,

Former Member
0 Kudos

Moderator message - Please post in the correct forum and search before asking post locked Rob