CRITICAL
Rule Definition
Identify "exists" and "not exists" independent clauses:
- solve a potential performance and disk space issue
- applicable for all sql, including embedded sql
Remediation
Check the statement and if so, add a join clause between exists and parent object.
Violation Code Sample
The following query should be reviewed:
select name
from person
where exists (select 1
from children)
Fixed Code Sample
Add a join between children table from exists clause and person table from parent query:
select name
from person
where exists
(select 1
from children
where children.fatherid = person.id)
Related Technologies
Technical Criterion
Efficiency - SQL and Data Handling Performance
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.