- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Using SQL statements in ABAP Programming and Database performance
The basic principle for performance is that there should be minimal data transferred between application server and database.
- For your first question, I would suggest to select only the fields that are required. So, don’t use SELECT * in case you don’t require all the fields. But in specific scenarios, if you have multiple SELECT statements at various parts of your program querying the same table but different columns, it is advisable to use SELECT * as the output is stored in a buffer till your program execute. In that case, when you come to subsequent select, the system uses the buffer memory.
- In case you want to get the output in a sorted manner, it is better to use SORT as compared to ORDER BY.
- In case of a nested SELECT statement, be very careful especially if there is a large amount of data expected as output.
Your second query regarding JOIN and FOR ALL ENTRIES IN is irrelevant as both serve a different purpose. JOIN is to join two database tables and fetch the data from database whereas “FOR ALL ENTRIES IN” is used to join a database table with internal memory table. So you can’t use them as alternatives to each other.
- Related Articles
- Adding a condition using SQL or an ABAP program and difference in performance
- Create database view in SAP ABAP
- Difference between hierarchical and network database model in SQL
- Usage of backtick in SQL statements?
- Using ABAP, changing a value in itab by getting data from database table
- Switch statements in Dart Programming
- In SAP ABAP, mapping two database table fields
- Identify the database used for backend in ABAP
- Difference between Primary key and Foreign key in SQL Database
- Create User SQL in SAP HANA database
- Create View SQL in SAP HANA database
- Database Wars: MSSQL Server, Oracle PL/SQL and MySQL
- Run SQL file in MySQL database from terminal?
- “Where” clause not working while updating database record in ABAP
- What is NoSQL (Not Only SQL database)

Advertisements