• Luis Cazares (8/2/2012)


    Thank you Sean, I know it might be a lot of work looking at it in depth (when is not really your job).

    About the NOLOCKs they were there when I got here and considered as a good practice in here, but after reading some articles you've posted in other topics I'm trying to change this (they're off my query now).

    Sorry if I come off a bit preachy on this topic but it is something that really hits home. I won't get into great detail but I worked for a company that mandated the use of the NOLOCK hint on every single query for performance. I did everything I could to convince them this was a bad idea for a lot of reasons. We processed debit card transactions on a scale of hundreds of thousands of transactions a day. All sorts of nasty stuff happened because of dirty reads and a lack of understanding.

    However, my question about the columns was if it made a significant difference if I took the information directly from the table (which is in another database) instead of taking them from the view (based on the views, based on the original tables). I'm making the test right now.

    I somehow missed the detail about this data residing on another database. It looks like the view has more columns than you are using in your select statement? It would definitely increase performance if the view either reduces the columns or you get the data directly.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/