Is it good to process views instead of source tables in stored procedures? (even if the view does not provide any different data)
I always thought this might be a good idea because it is an extra layer of abstraction and its similarity using properties instead of member variables in class functions.
But now I looked at the stored procedures created by the ASP.NET membership provider, and they always query tables directly.
I know that you cannot easily insert data when using views, but if the stored procedure only requests data if you use tables directly anyway? If so, what is the main reason? (Performance?)
A view is just a macro that expands into an external request.
If your view contains several joins, then when you join other views, you suddenly have 20 or 30 JOIN methods, when you really see 3 JOINs in the SQL stored procedure. You will also find that each query is different: why continue to join the same 20 or 30 tables for each query?
As a rule, there is no benefit if the view is not indexed / materialized and the optimizer can use it.
, , , : ? .
( ).
, (, SUSER_SNAME),
-, . , , ( ), .
Sql Server, where, :
, , , .
, sarg. ( Sql Server) - 5 .
, "" , , , . , -.
:
1 - ,
2 - . , , "member" "non_member". . , - , "member" "non_member", "user" . , , . , .
SQL Server ( ) , , , , . , , , SPRC , , .
, ? , , , , , , .
, , , , . SPROC INSERTS UPDATES, .
, , ( ), , ( ) , , CODING (, - , , SPROC ?).
SPROC, .,.
Source: https://habr.com/ru/post/1790197/More articles:An exception of type "System.OutOfMemoryException" is excluded - .nethow to move javascript to footer in drupal - performanceHow taxation of the game card grid will be in a web browser? - performancehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1790195/advice-for-supporting-both-mac-and-windows-desktops&usg=ALkJrhig7rIYmMLFe1QgYB4TG18DVdS1VAOpen the context menu by clicking on the menu item - androidstack location and vtable [re] - c ++Algorithm for checking quadrant horizontal symmetry? - algorithmMediaElement.js останавливает всех игроков - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1790201/too-many-pattern-matches-to-write-down-for-quadtrees&usg=ALkJrhh7jbiw8919yFv8WxRsiL-3gG4w6wflashvars does not work in android browser - androidAll Articles