I have a user-defined function that navigates down a hierarchy within a single table and returns a table of the uid's and names. The result is used in joins to 'include' all records beneath the supplied uid. When I execute the code extracted from the udf in Query Analyzer, it takes less than one second. When I call the udf in Query Analyzer, it takes two minutes. I have tried supplying index hints with no success. Any helpful direction appreciated!! Thanks.