• Ed Wagner (9/4/2013)


    Are the returned data sets the same no matter who runs the query? If you're selecting everything from a TVF, what is that function doing? Does it depend on the user who's running it to determine what data to bring back? If so, it might be returning more data for one user over another. If the username is used in a WHERE clause somewhere, it could be using a different index or even a full table scan because there's no covering index.

    I know I might be reaching here, but something has to be different for that kind of a performance difference.

    Had not considered that, but unfortunately the result sets are identical. I'll dig into the query more (layers upon layers of views and TVFs) to see if a username is specified anywhere.

    I only started at this company 2 weeks ago, so still trying to get the lay of the land.