0

I'm using SQL Server 2005 and I've got a fairly complex query which is taking a second or two to execute.

I wanted to debug performance using the query plan, but when I include the actual execution plan in the output, the query goes from taking 2 seconds to nearly 2 minutes - sometimes a lot longer.

The only somewhat interesting code in this query are a couple of cross applies against a table valued function. Interestingly, when I remove these cross applies, the query executes in about 100ms.

Is this a known issue?

RMD
  • 3,421
  • 7
  • 39
  • 85
  • You say "debug performance using the query plan". Debug and include query plan are not the same. Debug does take longer. – paparazzo Nov 12 '12 at 22:37
  • I'm not using the debugger. I'm simply using the query plan to diagnose a performance issue. I used the term "debug" in the general sense. – RMD Nov 13 '12 at 14:51
  • I was about to post the textual execution plan, and I discovered that when requesting the textual version it returns instantly. It only appears to be the graphical plan that takes a long time. – RMD Nov 13 '12 at 14:56

0 Answers0