Removing duplicate entries from driver tables enables OPEN SQL
to generate fewer queries for getting the same data, giving a
performance boost.
Noncompliant code example
SELECT carrid , connid , seatsocc FROM flights
INTO TABLE seatsocc_tab
FOR ALL ENTRIES IN conn_tab
WHERE carrid = conn_tab-carrid
AND connid = conn_tab-connid.
Compliant solution
SORT conn_tab BY carrid.
DELETE ADJACENT DUPLICATES FROM conn_tab COMPARING carrid.
...
SELECT carrid , connid , seatsocc FROM flights
INTO TABLE seatsocc_tab
FOR ALL ENTRIES IN conn_tab
WHERE carrid = conn_tab-carrid
AND connid = conn_tab-connid.