Avoid Unfiltered SELECT on Database Tables (Full Table Scan Prevention)
Overview
Flag SELECT statements on DB tables without a WHERE clause.
ATC Finding Message:
Avoid SELECT without a WHERE condition on database tables (full table scan)
Rationale
Executing a SELECT statement on a database table without an explicit WHERE clause reads every single row in the table, bypassing database indexes and causing full table scans. On large transactional or master data tables, this exhausts database memory, saturates network bandwidth, and leads to critical system performance degradation.
Standard: Always filter database reads with an index-backed WHERE condition. For paging or sampling, use UP TO n ROWS.
Non-Compliant
" Critical: Scans millions of database rows
SELECT * FROM t000 INTO TABLE @DATA(lt_data).Compliant
" Optimized: Targeted read with WHERE filter
SELECT * FROM t000
WHERE mandt = '100'
INTO TABLE @DATA(lt_data).Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value | Description & Guidance |
|---|---|---|---|
ALLOW_UP_TO_N | Boolean | false | Allow SELECT statements without a WHERE clause when restricted by UP TO n ROWS |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
" Standard pseudo-comment:
... "#EC NO_FULL_SCAN_SELECT
" SAP CI_ prefix format:
... "#EC CI_NO_FULL_SCAN_SELECTRelated Rules
- Avoid UPDATE or DELETE Without a WHERE Condition (Catastrophic Data Wipe Prevention) —
#EC NO_UNFILT_DML - Avoid BYPASSING BUFFER in SELECT Statements —
#EC NO_BYPASS_BUFFER - Avoid SELECT * in OpenSQL Queries (Minimize Memory & Network Overhead) —
#EC NO_SELECT_STAR
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_FULL_SCAN_SEL - Implementation File: zcl_skylint_no_full_scan_sel.clas.abap