For aggregation A0, A1, A2

Source: Internet
Author: User
TheAggregationisoneforthemostimportantthingforimprovingqueryperformanceinSSAS. YoucancreateaggregationmanuallyinAggregationTab -- AdvancedView. AnaggregationistotheresultofanSQLSELECTstatementwithaGROUPBY

The Aggregation is one for the most important thing for improving query performance in SSAS. you can create aggregation manually in Aggregation Tab -- Advanced View. an aggregation is to the result of an SQL SELECT statement with a GROUP

The Aggregation is one for the most important thing for improving query performance in SSAS. You can create aggregation manually in Aggregation Tab --> Advanced View.

An aggregation is to the result of an SQL SELECT statement with a GROUP BY clause. An aggregation for [product]. [color] is (T-SQL ):
Select catalog, SUM (VALUE) FROM TABLE

Group by color

For example, in sample cube [Adventure Works] (you may need to download sample cube since you ask question here frequently)

If you run the below query:

Select [Measures]. [Internet Order Quantity] on 0

, [Product]. [Color]. [Color] on 1

From [Adventure Works]

Where [Date]. [Calendar Year]. & [2003]

Create a trace, then you will find the query scan the partition not the aggragation:

Started reading data from the 'Internet _ Sales_2003 'partition.

So, how to create a aggregation for this query? You need to switch to Advanced View-> select the aggration you created from the c design wizard and then in the grid

A0 A1 A2 ......

Attribute

...

...

Color *

...

Each column (A0 .. AN) is an aggregation. in column A0, unselect all the attributes, and then select the attribute color. after that, process the partition 'Internet _ Sales_2003 '. in SSMS, clear the caching through:

Adventure Works dwx 2008

Execute the query:

Select [Measures]. [Internet Order Quantity] on 0

, [Product]. [Color]. [Color] on 1

From [Adventure Works]

Where [Date]. [Calendar Year]. & [2003]

In the trace you created, you will find this:

Started reading data from the 'aggregation 1 'Aggregation.

To optimize one query, you just need to see the event 'query Subcube Verbose 'in the trace, to find everything other than a zero by an attribute, and then create aggregation for that. for example, in above query we used:

Dimension 3 [Product] (0 0 0*0 0 0 0 0 0 0 0 0 0 0 0 0 )... [Color]: *…

This means we can create aggregation for the attribute color.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.