Problem solve Get help with specific problems with your technologies, process and projects.

Improvement on SELECT with fieldlist

This is some extra information regarding Marco Casalino's tip on how to improve performance of a select statement.

This is some extra information regarding Marco Casalino's tip on how to improve performance of a select statement....

It is true that performance will be improved when using the option he chooses, but it is even better to specify the field list in the SELECT statement. Just check the PREPARE operation in the SQL trace with 'Explain' and you can see why.


Report Zperformance.

data: ta_bkpf_1 type standard table of bkpf.

data: begin of ta_bkpf_2 occurs 0,
         belnr like bkpf-belnr,
         bukrs like bkpf-bukrs,
      end of ta_bkpf_2.

* Execute a select three times, just to check performance.
* First start SQL trace in other session, that execute this program.
* Check the trace and use EXPLAIN button for PREPARE operation
* (Oracle DB used)

* Option 1: bad option
select * from bkpf into table ta_bkpf_1 up to 100 rows.

* Option 2: better option
select * from bkpf into corresponding fields of table ta_bkpf_2
                   up to 100 rows.
* Option 3: Best option
select belnr bukrs from bkpf into table ta_bkpf_2 up to 100 rows.

This was last published in August 2002

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close