all groups > sql server mseq > october 2005 >
You're in the

sql server mseq

group:

Views


Views Travis
10/25/2005 1:48:05 AM
sql server mseq: Hi ,

If I create a view consist of this query "Select Sum(Amt) From Table1".
Is it increase the performance rather then pass the "Select Sum(Amt) From
Table1" SQL statement to the reporting tools ?

--
Re: Views Hugo Kornelis
10/25/2005 11:21:07 PM
[quoted text, click to view]

Hi Travis,

The best analogy for a normal view is a macro in many program languages:
the name of the view gets replaced with it's definition before it is
sent to the query optimiser.

Executing SELECT ... FROM ViewName would normally result in exactly the
same performance as executing the SELECT statement that was used to
create the view.


Indexed views are a different cup of tea. When you create an index on a
view, the data in the view is physically stored on your disk. This is
particularly useful if you have views that contain lots of aggrregated
data, are queried quite often, and the underlying data doesn't change
often.

Best, Hugo
--

AddThis Social Bookmark Button