Assume we have tables Order and Orderlines
Every Order has 50 columns , each length 20
Every Order has 100 lines .
Each line has 50 columns with length 20 .
SingleQuery-
If we do join Order and Orderline amount of data retrieved (in characters)is
((50*20 ) + ( 50*20))*100) =200,000
Two Query-
If we get Order and then Orderline
(50*20) = 1000
(50*20*100) = 100,000
Total = 101,000
If we keep adding to this and make it even deeper graph then the volume of data is going to be more and more with the single query.
What impact does this have on performance?
The trade off clearly is less database calls as opposed to more volume.
|