K
Keith Sudbury
Guest
For future reference the problem is that you were only using the leading column on the compound index (StartNum) because you were using a range match on that column. So your query was reading all TT1 records that were LE TT2.foo... and then brute force evaluating EndNum. You only get to use both columns in the index if the first is an equality match. As the StartNum value increased you were reading more and more TT1 records.
Continue reading...
Continue reading...