Answer the question
In order to leave comments, you need to log in
SQL View vs individual queries with JOIN's?
Does access to SQL View and a specific request with joins differ in terms of resources? (There can be 3-4 joins and plus checks for the sum of values + checks for emptiness, in short, a complex query)
At first glance, this is the same thing, but
I would like to know if SQL View is just for convenience and beauty, or does it reduce resource usage?
Thank you.
Answer the question
In order to leave comments, you need to log in
SQL View is used primarily if some users need to provide summary information from tables that are closed to them, excluding access to all columns of the table, or provide only aggregated information (counts, sums, averages), etc., without providing access to the original selection .
To delegate summary data to another user, but not to give the source data - this is just about the view.
In my understanding, there is only one way a view can improve performance. If the sample contains data from rarely changed tables or columns, and the DBMS is able to separately cache the view and it is possible to configure the cache, then you can make fast data sources on views based on rarely changed tables. The most striking example is obtaining a tree structure of an organization with information about the heads of departments. Such a query is burdened with recursiveness, and the data rarely changes. You can make a view from such a request and cache it correctly. And it will become easier, uniform, and possibly more productive to use the organization structure in other queries.
views are not just for beauty, but also do not reduce the use of resources
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question