April 10, 2014 at 1:32 pm
Hi,
I just made view based on 2 tables to get basic customer info, then tried to check performance vs 2 JOINs and didn't see any differences, what is your opinion?
Does it make sense to have those small views? Probably just for matter of usability not performance...
Thanks all
Mario
April 10, 2014 at 1:50 pm
First thing: Views are not a performance tuning technique. This is because SQL in-lines the views during parsing phase and so by the time the optimiser gets the query, there's no view left in it.
Small views like that aren't going to impact performance, so they're for usability. When you start getting larger views, aggregation in views or really complex views you may well see performance degradations. Stay simple and you'll be fine.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply