• Good stuff. Thanks for info - and the links others have supplied to asociated information is helpful too.

    We have found #temp tables often significantly outperform derived tables in situations where there is a large amount of data. We often create "driver" tables of the primary keys for the data we want from several other tables. If this driver table is used in several queries, there is a marked perfromance improvement.

    Key thing that most everyone here seems to agree on - for poor performing queries try different solutions. Don't fall in love with a single technique and expect it to work for everything.