Google Analytics

onsdag 3. oktober 2012

SSAS 2005: OLAP Cube Performance Tuning Lessons

Intro
A recent project has forced me (which is a good thing) to learn both the internals of SSAS 2005 as well as various performance tuning techniques to get maximum performance out of the OLAP server. It goes without saying that the grain of both your underlying data warehouse's Dimensions & Facts will drive how large your cubes are (total cube space). It also should be a given that Processing Time & Query (MDX) Execution Time usually compete with one another. Given the same grain of a model, the more Grain Data, Indexing, and Aggreggations you process upfront should generally result in a more performant end-user experience (but not always). And while ETL & Cube Processing time is of importance, in the real-world it is the end-user experience (capability and performance) which drives the DW/BI solution's adoption!

Throw-out unused Attributes/Optimizing Attributes/Leverage Member Properties The more dimensional attributes you create infers a larger cubespace, which also means more potential aggregations and indexes. Take the time to review with your clients the proposed set of attributes and be sure they all provide value as a 1st class Dimension Attribute. Also, if you find attributes are used primarily for informative purposes only consider leveraging Member Properties instead of creating an entire Dimension Attribute. Also, the surrogate key for your dimensions almost never add business value, delete those attributes and assign the keyColumns of your dimension's grain member (ie it's lowest level) attribute to the surrogate key. If an attribute participates in a natural hierarchy but is not useful as a stand-alone attribute hierarchy you should disable it's hierarchy via the AttributeHierarchyEnabled setting. Finally, be aware that if you have a 'deep' dimension (ie like 19 million members) at its lowest grain, any additional attributes you add will incur much overhead as they have a much higher degree of cardinality.

Set Partition Slices The question of whether or not you must explicitly set a partition's SLICE property is clearly documented incorrectly in SQL Server 2005 Books Online (BOL). For all but the simplest partition designs you should consider setting the SLICE property to match the source property (ie the dataset definitions should match across both properties). For those who do not know, a partition's SLICE is useful for query execution purposes, the SLICE tells the formula|storage engine which partition(s) hold the data that is being requested of it. Please see resources section below for more information on this.

Optimizing Attribute Relationships Attribute relationships are the developer's mechanism to inform the OLAP server of the relation between attributes. Just like Fact Tables (measure groups) relate to dimension in various ways (Regular, Referenced, Fact, Many-to-Many), dimension attributes can relate to one another in various forms (One-to-One or One-to-Many).Also, you can set the RelationshipType to Flexible or Rigid. If you know your member's change over time (ie reclass), make sure to leave this setting as Flexible, otherwise set it to Rigid. Take the time to thoroughly review your attribute relationships and ensure that both represent their natural hierarchy and are optimized!

Scalable Measure Group Partitioning & Aggregation Strategies This is one of the better known techniques but it is still of utmost importance. Make sure to design your measure group's partitions to optimize their performance (both processing and query execution). If your system has a 'rolling window' requirement also account for this in your ETL design/framework. You should almost always partition your measure groups by the DATE_KEY and match the underlying relational data warehouse (RDW) partitioning scheme. The basics of this is your 'hot' (the current period) partition should be optimized for query-execution time via setting a different Aggregation Design as opposed to the 'colder' (older) partitions. Also, if your main storage device (ie SAN usually) cannot hold all of your required data, consider leveraging Remote Partitions to offload the extreme 'cold' partitions to slower storage.

Continuously Tune Aggregations Based On Usage Most documentation in the community clearly states the order of creating effective aggregations is to first leverage the Aggregation Design Wizard, enable the Query Log, and then re-tune the aggregations using the Usage-Based Tuning Wizard. What is not mentioned (near enough anyway) is to continuously retune your aggregations using a refreshed Query Log using the Usage-Based Tuning Wizard. By doing so you are ensuring your aggregations are periodically revised based up recent, real-world usage of your cubes.

Warming the Cache Another well known technique...by issuing real-world MDX queries onStartUp of the MSOLAP service your cube's cache will be pre-optimized.

Be Mindful of Many-to-Many Dimensions Performance Implications While M:M dimensions are a powerful feature of SSAS 2005, that power comes at the cost of query-execution time (performance). There are a few modeling scenarios where you almost have to leverage them but be aware that if you are dealing with large amounts of data this could be a huge performance implication at query-time.

Control of the Client Application (MDX): That is the Question
A lesser discussed matter yet still very important is how much control you have over the MDX issued to your cubes. For example, Excel Pivot Tables and other analytical tools allow the user to explore your cubes with freedom pending the security (no Perspectives are not a security measure). If you can write (or control) the MDX being issued by the end-user then obviously you have more control to ensure that actual MDX is optimized.

Got 64-Bit? Multi-Cores? For enterprise-class Microsoft DW/BI engagements forget about x86/single-core, period. Analysis Services can chew through (process) more data, in higher-degrees of parallelization with x64 multi-core CPUs. Storage|Formula engine cache rely on memory...long-story short, Analysis Services has been designed to perform at higher levels of scalability when running on multi-core/x64 CPUs. Also, be sure to set Analysis Service's Min/Max Thread settings properly for both Query & Processing.

Conclusion I am dedicated to life-long learning. I cannot take full credit for my content above as much of this knowledge was the work of others as well as my own testing. The resources section listed below gives credit where it is due accordingly. Take the time to learn and implement highly-performant SSAS 2005 cubes to ensure your project's stakeholder’s first query is a performant one!

Resources Microsoft SQL Server 2005 Analysis Services (best SSAS 2005 OLAP internals book out!) by SAMS Publishing: http://safari.samspublishing.com/0672327821
SQL Server Analysis Services 2005 Performance Tuning Whitepaper (a great tuning document): download.microsoft.com/download/8/5/e/85eea4fa-b3bb-4426-97d0-7f7151b2011c/SSAS2005PerfGuide.doc
HP Solutions with Microsoft SQL Server: http://h71028.www7.hp.com/enterprise/cache/3887-0-0-0-121.html

KPI for Hospitality Business - Important Calculations (BI) for Hospitality


Key Performance Indicators (KPI) for Hospitality industry help remove the guesswork from managing the business by checking the numbers that tell what’s really happening.
There’s a business saying: ‘If you can’t measure it, you can’t manage it!’ Real, responsive management needs reliable and truthful figures on which decisions can be based. If there are problems, you can take corrective action quickly. If you are having success, you’ll know to do more of what you’re doing! Good figures also give you a wider understanding of your success – sometimes if it’s a quiet month (when your suppliers are telling you that ‘everyone’s quiet!’) you’ll see that some of your KPIs are actually improving (ex. sales per head).
KPIs in Hospitality industry can be categorized for functions like Reception, Housekeeping, Maintenance, Kitchen, Restaurant, Sales, Store, Purchasing, etc.

Staff KPI:- Wage Cost %: wage costs as a percentage of sales
- Total Labour Cost %: not just wages but also the other work cover insurance, retirement and superannuation charges and other taxes that apply on your payroll
- Total Labour Hours: how many hours worked in each section. This is useful to compare against sales to measure productivity
- Event Labour charge-out: Hotels usually charge-out service staff at a markup on the cost of the wages paid. Are you achieving a consistent mark-up?
- Labour turnover: number of new staff in any one week or month
- Average length of employment: another way to look at your success in keeping staff. Add up the total number of weeks all your people have worked for you and divide this by the total number of staff
- Average hourly pay: divide the total payroll by the number of hours worked by all staff

Kitchen Management KPI:- Food Cost %: measured by adding up food purchases for the week and measuring them against your food sales
- Total Food Costs: how much was total food bill? Sometimes a useful figure to show staff who think you are made of money
- Food Costs per head: see every week how much it costs to feed an average customer
- Kitchen Labour %: measure kitchen productivity by comparing kitchen labour against food sales
- Kitchen Labour hours: how many hours worked in this section? Compare against sales to measure productivity
- Stock value: food stock holding- It should be less than a week’s use, but can slip out if you are storing frozen food
- Main selling items: weekly sales from POS or dockets & know the best sellers and map these on the Menu Profitability
- Kitchen linen costs: cost of uniforms, aprons & tea-towels can be a shock! How many tea-towels are being used each day?

Front House Management KPI:- Total Sales Per Head: total sales divided by number of customers. This may vary between different times of the day
- Number of customers: simple! A good measure of popularity
- Food, Dessert, Beverage Sales per head: how much your menu appeals to your customers (do you have all the choices they want), & how well your staff are selling.
- Seating Efficiency: how well are tables being turned over while still offering high quality customer service
- Basket Analysis: how many items do lunch customers buy? What else do morning coffee drinkers order? Grab a pile of dockets and look for ordering patterns
- Linen costs: uniforms, aprons etc.
- Front of House Labour %: how many hours worked in this section? Compare against sales to measure productivity
- FOH Labour hours: how many hours worked in this section? Compare against sales to measure productivity
- Customer satisfaction: Feedback forms, complaints and other methods that are hard to quantify sometimes but worth making an attempt.
- Strike rate: if 500 people came to hotel last night & only 100 ate at the bistro, your ’strike rate’ would be 1 in 5, or 20%
- RevPASH Revenue per Available Seat Hour: take the total number of ’seat hours’ and divide total revenue for a period by this number

Bar & Restaurant Management KPI:- Sales per head: how much your beverage and wine appeals to your customers and how well your staff are selling
- Gross Profit on sales: difference between what you sold and what it cost you. The sales mix can influence this heavily
- Average Profit % on sales: useful to see if your sales are holding steady, although ultimately the actual Gross Profit (real money) will matter the most
- Stock value: It’s worth checking with your suppliers and seeing how much you can order ‘just in time’
- Stock turnover: how fast is your cellar stock selling?
- Carrying cost of stock: what is the cost of financing the stock?
- Sales / stock-take discrepancies: Alcohol is security problem, & keeping an eye on ’shrinkage’, staff drinks and stealing a constant problem

Banquet Sales Management KPI:- Number of customers: simple! A good measure of popularity.
- Visits by your top 100 or 200 customers: they provide a huge proportion of your sales! Track their frequency and spending – these people are gold!
- Sales per head: across all areas
- Marketing and advertising costs: total value of spend, always trying to measure it against response
- Response rates: how many people responded to different campaigns and what effect did this have on profit?
- Press mentions: keeping your eyes open for favourable mentions
- Bookings: in the current week and month and coming up. Also in peak times, eg Christmas.
- Event inquiries: No. of inquiries about large bookings & functions, especially if a campaign to promote them is on
- Sales inquiry conversion rate: No. of inquiries that turn into actual sales. why so few people were ‘converted’ – was it the quality of the promotional material, skill of the sales staff, pricing or make-up of your function menus and facilities?

Finance & Admin Management KPI:- Cash position at bank: how much do you have available after reconciling your cheque book?
- Stock-take discrepancies: measure of efficiency of each department, but also of administrative systems in place
- Total accounts due: how much do you owe?
- Total accounts payable: needs careful management if you have accounts, eg large restaurants
- Return on Investment: profit business makes can be measured as a percentage return on the amount invested in it
- Taxes owed: to know how much is owed at any one time so it is not ’spent’
- Sales & costs: actual figures compared to what budgeted for a period
- Administration labour costs: strong and skilful administrative support will be essential to manage the KPIs listed above!
- IT efficiency: how much down-time for IT systems? How accurate is the POS system?

Other KPIs:- Revenue per available room
- Average daily rate of rooms
- % of occupancy of rooms
- Average cleaning costs per room
- % of reservation requests cancelled with / without penalty
- % of rooms with maintenance issues
- % of cancelled reservation requests
- Average number of guests per room
- Average length of stay of guests
- % of non-room revenue
- % of cancelled rooms occupied
- Kilowatt-hours (kwh) per room
- Number of hotel guests per employee
- Gross operating profits per available room
- % of guests who would rank stay as exceeding expectations
- Waste per night per occupied bed space

Provided by: Maia Intelligence and posted by: Besim Ismaili

Data mining - SSAS and DMX

 
Computers can be programmed to sort through enormous amounts of data
looking for patterns. It’s an exciting new frontier that goes by many different
names — in business, the most common ones are data mining, predictive
analytics, and machine learning — but this book sticks to “data mining”.
The Microsoft data-mining algorithms are part of SQL Server Analysis
Services, but you don’t have to be a super computer ninja to access and use
them. Microsoft offers a free Excel Data Mining Add-In that transforms Excel
into a simple, intuitive client program for the SSAS data-mining algorithms

Analyzing data - SSAS

 
As you can imagine, the amount of data contained in a modern business is
enormous. If the data were very small, you could simply use Microsoft Excel
and perform all of the ad-hoc analysis you need with a Pivot Table. However,
when the rows of data reach into the billions, Excel is not capable of handling
the analysis on its own. For these massive databases, a concept called OnLine
Analytical Process (OLAP) is required. Microsoft’s implementation of OLAP is
called SQL Server Analysis Services (SSAS), which I cover in detail in Chapter 8.
If you’ve used Excel Pivot Tables before, think of OLAP as essentially a massive
Pivot Table with hundreds of possible pivot points and billions of rows
of data. A Pivot Table allows you to re-order and sum your data based on different
criteria. For example, you may want to see your sales broken down by
region, product, and sales rep one minute and then quickly re-order the groupings
to include product category, state, and store.
In Excel 2010 there is a new featured called PowerPivot that brings OLAP to
your desktop. PowerPivot allows you to pull in millions of rows of data and
work with it just like you would a smaller set of data. After you get your Excel
sheet how you want it, you can upload it to a SharePoint 2010 site and share
it with the rest of your organization.
With PowerPivot you are building your own Cubes right on your desktop using
Excel. If you use PowerPivot, you can brag to your friends and family that you
are an OLAP developer. Just don’t tell them you are simply using Excel and
Microsoft did some magic under the covers.
When you need a predefined and structured Cube that is already built for
you, then you turn to your IT department.

Integrating data from many sources - SSIS

The many different systems and processes that make up an organization
create data in all shapes and forms. This data usually ends up stored in the
individual systems that generated it — but without any standard format.
Fortunately, SQL Server has a component — SQL Server Integration Services
(SSIS) — that can connect to these many different data sources and pull
the data back into the central data warehouse. As the data moves from the
source systems to the Data Warehouse, SSIS can also transform it into a standard
useful format. The whole process is known as Extract, Transform, and
Load (ETL).

Reporting on data - SSRS

When you have a Data Warehouse, you likely don’t want to look at rows
and rows of data; instead, you want to visualize the data and give it meaning.
Building reports that answer a particular question (or set of questions)
means taking raw data and turning it into information that can be used to
make intelligent business decisions. SQL Server Reporting Services (SSRS), a component of SQL Server — builds reports by doing that bit of magic.
SSRS has features that can make your reports as fancy as you like — gauges,
charts, graphs, aggregates, and many other snazzy ways to visualize the data

Data warehousing and data marts

 
Although computer systems help solve many problems in business, they use
so many different kinds of programs that they can’t always communicate
easily with each other. A tremendous number of systems make up a modern
organization — payroll, accounting, expenses, time, inventory, sales, customer
relations, software licensing, and so on. Many of these systems have
their own databases and ways of storing data. Combining data from the
tangle of systems — let alone doing something useful with the combined
data — becomes extremely difficult.
Business intelligence creates a “big picture” by storing and organizing data
from many disparate systems in one usable format. The idea is to make the
data readily accessible for reporting, analysis, and planning. A data warehouse
is a central database created for just that purpose: making the data
from all those sources useful and accessible for the organization. The idea is
to give decision-makers the information they need for making critical business
decisions.
A data mart is a more specialized tool with a similar purpose; it’s a functional
database that pulls particular information out of the overall Data Warehouse
(or even directly from source systems depending on who you ask) to answer
specific queries. For example, a manufacturing location may need to compile
some specialized data unique to the process used to make a particular product.
The overall data warehouse is too big and complex do that job (or to modify
effectively to handle it), so a smaller version — in BI lingo, a data mart — can be
created for this one manufacturing location.
The Microsoft SQL Server Database Engine manages not only data warehouses,
but also data marts — and both types of data storage can become
massive. Fortunately, SQL Server addresses this problem by storing one
database across a cluster of many different servers. This approach accommodates
the enterprise as it grows in scale.