views:

132

answers:

4

I recently inherited a warehouse which uses views to summarise data, my question is this: Are views good practise, or the best approach? I was intending to use cubes to aggregate multi dimensional queries.

Sorry if this is asking a basic question, I'm not experienced with warehouse and analyis services

Thanks

+1  A: 

Cubes are a much better approach to summarize data and perform multidimensional analysis on it.

The problem with views is twofold: bad performance (all those joins and group bys), and inability to dice and slice the data by the user.

In my projects I use "dumb" views as a another layer between the datawarehouse and the cubes (ie, my dimensions and measure groups are based on views), because It allows me a greater degree of flexibility.

santiiiii
+2  A: 

Views are useful for security purposes such as to restrict/control/standardise access to data.

They can also be used to implement custom table partitioning implementations and federated database deployments.

If the function of the views in your database is to facilitate the calculation of metrics or statistics then you will certainly benefit from a more appropriate implementation, such as that available through a data warehouse solution.

John Sansom
thats what I thought, the views are only used in calculations, namely sum. Strange choice!
Stuart
A: 

I was in the same boat a few years ago. In my case I had access to another SQL server. On the second server I created a link server to the warehouse and then created my views and materialized views on the second server. In a sense I had a data warehouse and a reporting warehouse. For the project this approach worked out best as we were required to give access to the data to other departments and some vendors. Splitting the servers into two separate instances, one for warehousing and one for reporting also alleviated some of the risks involved in regards to secure access.

OhioDude
+1  A: 

Analysis Services and Views have the fundamental difference that they will be used by different reporting or analytic tools.

If you have SQL-based reports (e.g. through Reporting Services or Crystal Reports) the views may be useful for these. Views can also be materialised (these are called indexed views on SQL Server). In this case they are persisted to the disk, and can be used to reduce I/O needed to do a query against the view. A query against a non-materialized view will still hit the underlying tables.

Often, views are used for security or simplicity purposes (i.e. to encapsulate business logic or computations in something that is simple to query). For security, they can restrict access to sensitive data by filtering (restricting the rows available) or masking off sensitive fields from the underlying table.

Analysis Services uses different query and reporting tools, and does pre-compute and store aggregate data. The interface to the server is different to SQL Server, so reporting or query tools for a cube (e.g. ProClarity) are different to the tools for reporting off a database (although some systems do have the ability to query from either).

ConcernedOfTunbridgeWells
thanks for the answer, does this mean reporting via reporting services with cubes is possible?
Stuart
and what do you recommend for reporting off cubes?
Stuart
@stuart: Yes, you can use an Analysis Services Data Source, in reporting Services
John Sansom
@Stuart: See http://msdn.microsoft.com/en-us/library/ms159219.aspx
John Sansom
Yes, you can report off a cube using an analysis services data source - and issue a MDX query. It is useful in some cases, perhaps when you can make use of the cube's aggregations for performance or when you want to use calculated members (e.g. a YTD calculation) within the cube.
ConcernedOfTunbridgeWells