SQL Server Performance

View vs Tables ?

Discussion in 'General Developer Questions' started by Bredsox, Dec 23, 2005.

  1. Bredsox New Member

    I have a view(vwOrders) created based on two tables(Orders and OrderDetails).

    I am calling this view within the sp joins and seems to me that it's doing a lot of table scan.
    Which one is faster: Join with View or Two Tables in terms of performance? Thanks for the reply.

    Dan
  2. Luis Martin Moderator

    If you can create a view index, is the same.
    If you can't, pick the view query and paste into QA and try to find better indexes.


    Luis Martin
    Moderator
    SQL-Server-Performance.com

    Although nature commences with reason and ends in experience it is necessary for us to do the opposite, that is to commence with experience and from this to proceed to investigate the reason.
    Leonardo Da Vinci

    Nunca esperes el reconocimiento de tus hijos, eso ocurrirá luego de tu muerte


    All postings are provided “AS IS” with no warranties for accuracy.



  3. Bredsox New Member

    Thanks Luis for your prompt reply. So, my understanding from your reply is that it is better to join with view if it is indexed view otherwise table is better, am i right? We are using Standard version of SQL 2000 in the company so indexed view is not an option at this time. Thanks

    Dan
  4. Luis Martin Moderator

    Yeap Standard don't allow indexes views.
    So, is better to try to optimize queries.


    Luis Martin
    Moderator
    SQL-Server-Performance.com

    Although nature commences with reason and ends in experience it is necessary for us to do the opposite, that is to commence with experience and from this to proceed to investigate the reason.
    Leonardo Da Vinci

    Nunca esperes el reconocimiento de tus hijos, eso ocurrirá luego de tu muerte


    All postings are provided “AS IS” with no warranties for accuracy.



Share This Page