Mine won't return rows in the Docs table if they don't have corresponding values in at least one of the sub-tables. That might explain part of the rowcount difference. Whether that's correct or not is something only the OP can answer. If it's not correct, it's easy to modify the code to add another join to that table.
The I/O difference I originally noted was from one of the earlier queries, which did one scan per value in Docs, for each of the sub-tables. If that's been fixed, it's been fixed. But it wasn't noted till I tested for that, so I mentioned always testing I/O, that's all.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon