[dba-SQLServer] Difference between views and queries

Jim Lawrence (AccessD) accessd at shaw.ca
Fri Jun 11 13:38:32 CDT 2004


Hi Debbie:

Good point. As soon as you start pulling more data down the wire the
performance suffers. What I have traditionally found is that, unless you
have complete control over the design of a specific view, they end up
pulling more data than required, link to a host of miscellaneous functions
and can have very complex grouping and sorting routines that may not even be
indexed properly. In many cases, I have been involved with, power-users had
requested these complex views with little knowledge or concern with the
impact, on the meager system resources. These views have just become pseudo
data cubes. (I have seen sites where it takes almost thirty minutes to
populate a specific view.)

I feel that the raw data, should be pulled at the server end, using as
little grouping or sorting there, as realistically possible and at the
client end, is where the processing should be implemented. I am not
suggesting to pull more data across the wire, just less processing at the
server end. This does mean that you would have to have a desktop application
to subsequently manage the data and not just a web interface. On one site, a
report that had been an over-nighter (four hours processing) was reduced to
around fifteen minutes with the proper balance of FE and BE loading.

I agree that there is a much better security level through views. My issue
is that users should never directly see that far into the system, anyways.

Thanks for your comments
Jim

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Elam,
Debbie
Sent: Friday, June 11, 2004 6:13 AM
To: 'dba-sqlserver at databaseadvisors.com'
Subject: RE: [dba-SQLServer] Difference between views and queries


Just the opposite, I have always tried to harness the greater computing
power on the server and drag less data across the wire which is a
performance plus.  Views also have security independent of tables.  I have a
much better control of what data is editable and when by what view I use.

Debbie

-----Original Message-----
From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca]
Sent: Thursday, June 10, 2004 2:07 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer] Difference between views and queries


Hi John:

Personally, I see little reason to run views as their creation is spawned at
the server side and any hit on the server I try to avoid. The concept of
distributive computing has always appealed to me. Queries, run at the client
side.

There might be better performance with views, if there are limited people
accessing the server. Views limit, not that the client can see it anyway,
access to/display of the real table and present a pseudo table. Security?

HTH
Jim

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of jwcolby
Sent: Thursday, June 10, 2004 9:33 AM
To: SQLServer
Subject: [dba-SQLServer] Difference between views and queries


Can anyone explain the difference between a view and a query?  Views use a
query, plus the view keyword.  I have a couple of books that I have read the
chapter on Views, but I so far haven't managed to "get" why you wouldn't
just use the query itself instead of turning it into a view.


John W. Colby
www.ColbyConsulting.com


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com
- JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject
to the Attorney-Client Privilege, (2) an attorney work product, or (3)
strictly confidential. If you are not the intended recipient of this
message, you may not disclose, print, copy or disseminate this information.
If you have received this in error, please reply and notify the sender
(only) and delete the message. Unauthorized interception of this e-mail is a
violation of federal criminal law.
This communication does not reflect an intention by the sender or the
sender's client or principal to conduct a transaction or make any agreement
by electronic means.  Nothing contained in this message or in any attachment
shall satisfy the requirements for a writing, and nothing contained herein
shall constitute a contract or electronic signature under the Electronic
Signatures in Global and National Commerce Act, any version of the Uniform
Electronic Transactions Act or any other statute governing electronic
transactions.
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list