0

I've a problem of sql optimization

I've a View, inside this View I must use another View, now the problem is that I must call this "inner view" more than one time, so this "inner view" is recalculated each time, is there a way to calculate it only the first time?

davidinho
  • 169
  • 1
  • 14
  • How many tables / rows are you working with in the views? Are there complex calculations? Most times I can find ways to optimize the underlying views to be more efficient, but if that doesn't work you could try creating an indexed view. – RustProof Labs Feb 06 '15 at 12:36
  • Check the execution plan. –  Feb 06 '15 at 13:07
  • Nesting view is going to result in sub-optimal execution plans. It is a recipe for poor performance. Seems to me like you should explore CTEs. – Sean Lange Feb 06 '15 at 14:20

0 Answers0