Using Relationship Queries TopLink Default

9-50 Oracle Fusion Middleware Users Guide for Technology Adapters Master Column1 column2 ….. column100 Master1 ... Detail Detail Column1 column2 Detail1 ... Detail2 ... Detail100 ... In this example, 300 column values are returned as shown: columns in master + columns in detail x details per master = 100 + 2 x 100 = 300 With one query for all tables, the result set appears, as shown in the following example: Master Detail Column1 Column2 ... Column100 Column1 Column2 Master1 ... Detail1 ... Master1 ... Detail2 ... Master1 ... Detail100 ... Note that, in the case of one query for all tables, 10,200 column values are returned in a single result set, versus 300 in two result sets, as shown here: columns in master + columns in detail x details per master = 100 + 2 x 100 = 10,200 This can have a serious drain on network traffic and computation because 97 percent of the data returned is duplicate data. Also, if the master had two related tables detail1 and detail2 and there were 100 each in each master, then the number of column values returned would be over 10 million per master row. In general, you can use the following simple formula to estimate the relative cost of returning all rows in a single result set: Master columns + Detail1 columns + Detail2 columns + ... x Detail1s per Master x Detail2s per Master x ... bloat = ___________________________________________________________ Master columns + Detail1 columns X Detail1s per Master + Detail2 columns X Detail2s per Master + ... Note that for 1-1 relationships, this value is always 1, and if in the same example each master had two columns only and the details had 100 columns instead, and each master had only 3 or 4 details each, then the bloat would be 2 + 100 x 4 408 bloat = ____________ = ___________ ~= 1 2 + 100 x 4 402 Another disadvantage is that this setting could distort the meaning of the maxRows setting on an outbound select.