i have a table called orders. one column on order is customer_id
i have a table called customers with 10 fields
Given the two options if i want to build up an array
If this customer_id is unique in your customer-table (and the other IDs are unique in the other tables), so your query only returns 1 row per Application, then doing a single SELECT is certainly more efficient.
Joining all the required customers in one query will be optimized, while using lots of single SELECTs can't.
EDIT
I tried this with Oracle PL/SQL with 50.000 applications and 50.000 matching customers.
Solution with selecting everything in one query took
0.172 s
Solution with selecting every customer in a single SELECT took
1.984 s
And this is most likely getting worse with other clients or when accessing over network.