Click here to Skip to main content
15,917,062 members
Home / Discussions / Database
   

Database

 
GeneralRe: first three highest salaries Pin
Wendelius19-Aug-08 8:06
mentorWendelius19-Aug-08 8:06 
GeneralRe: first three highest salaries Pin
TheFM23419-Aug-08 18:36
TheFM23419-Aug-08 18:36 
QuestionView ??????? Pin
.NET- India 18-Aug-08 22:36
.NET- India 18-Aug-08 22:36 
AnswerRe: View ??????? Pin
That's Aragon19-Aug-08 1:19
That's Aragon19-Aug-08 1:19 
GeneralRe: View ??????? Pin
netJP12L19-Aug-08 4:14
netJP12L19-Aug-08 4:14 
AnswerRe: View ??????? Pin
John_Adams19-Aug-08 3:25
John_Adams19-Aug-08 3:25 
AnswerRe: View ??????? Pin
Jerry Hammond19-Aug-08 5:29
Jerry Hammond19-Aug-08 5:29 
AnswerRe: View ??????? Pin
Wendelius19-Aug-08 7:50
mentorWendelius19-Aug-08 7:50 
View was designed for two purposes, security and query simplification as many people has already pointed out. Articles provided clarify these aspects well. However, a common misbelief is that a view is faster than a query without a view. This is not always true. There are several situations where views are slower than plain select statements.

When a view is created, it's stored as an object which gives the optimizer a possibility to create a better plan for the query. When executing view, some (but not all) of the parsing and optimization can be skipped and this can result in (small) performance benefit.

However creating a view does not significantly modify execution plan. For example if SELECT * FROM Customers results in a full table scan, the situation isn't typically any different if the statement is wrapped inside a view. Execution of the view can be boosted in several ways but they always require structural changes in the database (materializing, different kinds of indexing, partitioning, federations etc) so they require administration.

Since optimizer must be very careful when calculating permutations that it doesn't risk correct results, many default SQL optimizations are easily skipped if a query is executed against a view. Typical example is so called predicate pushing when optimizer tries to apply a condition as soon as possible. However if a view is defined, predicate pushing may not be used since it would modify view results hence modifying the overall results. This is just one of the many examples when query against a view can be (significantly) slower that plain query.

Mika
QuestionHow to restore backup file from sqlserver2005 to sqlserver2000? Pin
Ashish Kumar Vyas18-Aug-08 19:50
Ashish Kumar Vyas18-Aug-08 19:50 
AnswerRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Colin Angus Mackay18-Aug-08 21:27
Colin Angus Mackay18-Aug-08 21:27 
AnswerRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Tripathi Swati18-Aug-08 21:40
Tripathi Swati18-Aug-08 21:40 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Ashish Kumar Vyas18-Aug-08 23:22
Ashish Kumar Vyas18-Aug-08 23:22 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? [modified] [follow d below steps] Pin
Tripathi Swati18-Aug-08 23:30
Tripathi Swati18-Aug-08 23:30 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Blue_Boy19-Aug-08 0:58
Blue_Boy19-Aug-08 0:58 
General[Message Deleted] Pin
Tripathi Swati19-Aug-08 1:12
Tripathi Swati19-Aug-08 1:12 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Blue_Boy19-Aug-08 1:18
Blue_Boy19-Aug-08 1:18 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? [modified] [follow d below steps] Pin
Ashish Kumar Vyas19-Aug-08 2:11
Ashish Kumar Vyas19-Aug-08 2:11 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Tripathi Swati19-Aug-08 3:14
Tripathi Swati19-Aug-08 3:14 
GeneralRe: How to restore backup file from sqlserver2005 to sqlserver2000? Pin
Wendelius19-Aug-08 5:02
mentorWendelius19-Aug-08 5:02 
Questionlower and UPPER String Pin
nelsonpaixao18-Aug-08 12:22
nelsonpaixao18-Aug-08 12:22 
AnswerRe: lower and UPPER String Pin
Blue_Boy18-Aug-08 12:53
Blue_Boy18-Aug-08 12:53 
QuestionPossibly a dumb question Pin
Jerry Hammond18-Aug-08 11:54
Jerry Hammond18-Aug-08 11:54 
AnswerRe: Possibly a dumb question Pin
Wendelius19-Aug-08 5:25
mentorWendelius19-Aug-08 5:25 
GeneralRe: Possibly a dumb question Pin
Jerry Hammond19-Aug-08 18:45
Jerry Hammond19-Aug-08 18:45 
Questionhelp setting up matrix cross-refrence query [modified] Pin
empulse18-Aug-08 4:49
empulse18-Aug-08 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.