Forum Discussion
Reporting Views
what is the deciding factor for creating views in datawarehouse for reporting purpose, how i would know whether i should create view , as far as i know views are created for performance enahancement purpose and only static calculations can be implemented in view
2 Replies
- rajendraongole1
Super User
Hi powerbiexpert22 - A view is generally not created for performance enhancement. A normal SQL view is primarily an abstraction/reusability/security/semantic layer. In most database engines, the underlying query is expanded into the execution plan, so simply putting a query into a view does not inherently make it faster. A normal view doesn't necessarily mean the database first generates the entire view and then filters it.
Note: Create a view when you need a reusable, governed and stable logical representation of warehouse data - not simply because you expect better performance.
Hope this helps.
- krishnakanth240
Super User
Views are created for abstraction and reusability. View is a stored query that runs at execution time, so it won't speed up. Create a view when you want to hide complex joins so multiple reports stay consistent. Also, Views are not limited to static calculations as they can include joins, aggregations and window functions as SQL runs each time so limitation is that they become inefficient over large datasets when queried repeatedly which is when a materialized view is the approach