Joining Tables: Table OrderWho Cares?
A then B
1,000 reads from A
For each A row do an index
scan into B (4 reads)
Total reads: 5,000
(1,000 for A +
1,000*4 for B)
B then A
50,000 reads from B
For each B row do an index
scan into A (3 reads)
Total reads: 40,000
(50,000 for B +
50,000*3 for A)
Table A - 1000 rows Table B - 50,000 rows
This is a difference of 35,000 reads!!!
Previous slide
Next slide
Back to first slide
View graphic version