Hi everybody,
I have a query with not optimally estimated cardinalities which results in large tempdb spills (sys.dm_exec_query_memory_grants says the query gets 1,8 Gb. After query is run in a separate session dm_db_session_space_usage says, the query required 18,5 Gb in the tempdb).
I would like to estimate what would happen (in terms of running time) if you could give the query more memory.
Is there some dirty way to do this? (trace flag or something like that)
And no, "updating statistics" doesn't help ;). See http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/5cf8e3f9-b112-433d-9aa6-7b1454f49a76 for details.