Rob and Mark,
I have a question for you that I think is in line with the discussion taking place in this thread. If you think I should break this out into another thread, let me know and I’ll do that.
Suppose I have a source system from which I have to retrieve, let’s say, order data directly from the database. Now, suppose that the order data is divided into two tables: a header table (call it HDR) and a detail table (call it DTL).
Would you say that retrieving the data with one SQL statement, such as SELECT * FROM HDR a, DTL b WHERE a.orderId = b.orderId, is preferred over selecting all headers first (ex. SELECT * FROM HDR) and then selecting the details header by header (ex. SELECT * FROM DTL WHERE orderId = )?
I’d think it is because databases are built to efficiently join data. Plus, it eliminates the overhead of having to issue multiple queries versus one. However, what if the header consists of a significant amount of data and/or there are several detail records for each header? Then, executing the join above could potentially have a serious impact on memory consumption given that the header information will be duplicated for each detail record within the result set.
I’ve seen both approaches implemented, so I was wondering what your opinion was on the matter.
Thanks,
Percio
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods