Hi all, I am new to the forum~
Suppose I have multiple tables, T1, T2, T3. I will use SELECT queries and apply AVG() and STDEV() on each of their columns, and average their results.
I can do this in two ways: one is to apply my SELECT multiple (3) times, then divide it by 3 in this case.
Another way is I create a View that UNIONS all T1 T2 T3, and apply AVG() and STDEV() on each columns.
Which solution is better? I mean, from a performance point of view. This is just a simplified version of my problem, and I would like to know what is the performance of using one (View) over the other (Table)... Does using View instead of table give me any performance overhead? Thanks everyone...They are the same solution. whether you use a select statment or a veiw you will be pulling data off the drives (or cache) to produce the answer. The view has the advantage of being pr-optimized. Views are generally used for this type of thing as it hides all the aggregation.
Don't know if this helped, Books Online has some interesting info look up views-SQL Server, overview and follow the hyper link to Scenarios for Using Views.sql
Showing posts with label apply. Show all posts
Showing posts with label apply. Show all posts
Monday, March 26, 2012
Monday, February 20, 2012
Performance Monitor Counters Disappeared
I rebooted my server (regular maint, every 2 month I just
restart it). When I started the performance monitor all
the counters that apply to SQL Server were gone. Without
reinstalling how do I get them back?Hi Gary,
What service pack do you have on SQL Server 2000? If it is SP 3, you want want to investigate if you are running into this problem.
FIX: "Performance Monitor Shared Memory Setup Failed: -1" Error Message ID: 812915.KB.EN-US
http://support.microsoft.com/?id=812915
Sincerely,
Yih-Yoon Lee [Microsoft]
Microsoft SQL Server Support
This posting is provided "AS IS" with no warranties, and confers no rights. Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
--
| Content-Class: urn:content-classes:message
| From: "Gary" <gary.hughes@.mail.sprint.com>
| Sender: "Gary" <gary.hughes@.mail.sprint.com>
| Subject: Performance Monitor Counters Disappeared
| Date: Thu, 25 Sep 2003 09:10:53 -0700
| Lines: 4
| Message-ID: <172d01c3837f$9839dcc0$a001280a@.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcODf5g5H2o4sj0ZSky9uKcnXc5MoA==| Newsgroups: microsoft.public.sqlserver.server
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:308334
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| I rebooted my server (regular maint, every 2 month I just
| restart it). When I started the performance monitor all
| the counters that apply to SQL Server were gone. Without
| reinstalling how do I get them back?
|
restart it). When I started the performance monitor all
the counters that apply to SQL Server were gone. Without
reinstalling how do I get them back?Hi Gary,
What service pack do you have on SQL Server 2000? If it is SP 3, you want want to investigate if you are running into this problem.
FIX: "Performance Monitor Shared Memory Setup Failed: -1" Error Message ID: 812915.KB.EN-US
http://support.microsoft.com/?id=812915
Sincerely,
Yih-Yoon Lee [Microsoft]
Microsoft SQL Server Support
This posting is provided "AS IS" with no warranties, and confers no rights. Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
--
| Content-Class: urn:content-classes:message
| From: "Gary" <gary.hughes@.mail.sprint.com>
| Sender: "Gary" <gary.hughes@.mail.sprint.com>
| Subject: Performance Monitor Counters Disappeared
| Date: Thu, 25 Sep 2003 09:10:53 -0700
| Lines: 4
| Message-ID: <172d01c3837f$9839dcc0$a001280a@.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcODf5g5H2o4sj0ZSky9uKcnXc5MoA==| Newsgroups: microsoft.public.sqlserver.server
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:308334
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| I rebooted my server (regular maint, every 2 month I just
| restart it). When I started the performance monitor all
| the counters that apply to SQL Server were gone. Without
| reinstalling how do I get them back?
|
Subscribe to:
Posts (Atom)