SQL Server Performance

Views & Joins - How many is too many???

Discussion in 'General Developer Questions' started by DBADave, May 1, 2006.

  1. DBADave New Member

    Accidental duplicate post. Please ignore.
  2. spacemonkey New Member

    My thought would be simply that treat views as joins if that is what they are. Let's say view A joins two tables and view B joins three. If you then create a view that joins A and B you really have four joins. A1 to A2, B1 to B2, B1 to B3, and A to B.

    When I run into a situation like what you are seeing, I often try to simplify where the data is coming from. Sometimes you can eliminate entire views by finding the same data elsewhere or by writing new views that take the place of two or more.

    As for function calls, that really depends on the function. Stating the obvious, some can be very complex and others not. I guess I would start by deconstructing the view giving you problems. You could create a tree structure mapping out the view heirarchy and start performance tracing from the base statements up. You may find one or two sub views in particular are responsible for the timeout and not the whole thing combined.

    John
  3. DBADave New Member

  4. khtan New Member

  5. Madhivanan Moderator

    Well. Continue with that topic

    Madhivanan

    Failing to plan is Planning to fail

Share This Page