>What bother me is the last line:
Joining intermediate result and intermediate result using temp index
Why it's not using the indexes PK_HistFile and FK_HistFile to join the tables HistFile and HistRec?
>
Sometimes the engine decides that the fastest way is to work with intermediate tables. You'll see that when there are fast ways to create the intermediate tables, and the resulting intermediate tables are small.
Tamar