ssas表格模型 权限控制_性能调整SSAS表格模型

article/2025/9/19 23:58:38

ssas表格模型 权限控制

Modeling for the xVelocity/Vertipaq engine is a completely different beast than modeling for your trusty multi-dimensional SSAS cubes.
In-memory = blazingly fast; At least that’s what you would think.
As Tabular models gain popularity with business users and developers alike, we’re starting to see that this isn’t always the case.
We’re going to take a look at some of the common errors and mistakes and how to avoid them.
And since the PowerPivot engine is the same – you will learn how to tune your PowerPivot-based Excel workbooks as well.

xVelocity / Vertipaq引擎的建模与可信赖的多维SSAS多维数据集的建模完全不同。
内存中=极快的速度; 至少那是您的想法。
随着表格模型在企业用户和开发人员中越来越受欢迎,我们开始发现情况并非总是如此。
我们将研究一些常见的错误和错误以及如何避免它们。
由于PowerPivot引擎是相同的–您还将学习如何调整基于PowerPivot的Excel工作簿。

PowerPivot was launched with the Vertipaq engine back in 2010, but when MS SQL Server 2012 was released with the SSAS Tabular mode, the Vertipaq engine had been rebranded as the xVelocity Engine.

PowerPivot于2010年与Vertipaq引擎一起启动,但是当MS SQL Server 2012以SSAS表格模式发布时,Vertipaq引擎已更名为xVelocity引擎。

It is, in fact, the same technology, which might confuse newcomers. I for one tend to use both names interchangeably, seeing as the Vertipaq name pops up all over the place.

实际上,这是同一技术,可能会使新来者感到困惑。 我倾向于将两个名称互换使用,因为Vertipaq名称随处可见。

At the heart of the engine – no matter what you call it – is the in-memory columnstore technology and some nifty compression techniques. The techniques have been discussed in-depth elsewhere and is not a topic for this article. But it’s worth knowing a bit about what is happening and why columnstore is different from your standard row-based SQL server.

不管您叫什么名字,引擎的核心都是内存中的列存储技术和一些精巧的压缩技术。 该技术已在其他地方进行了深入讨论,而不是本文的主题。 但是值得了解一下正在发生的事情以及为什么列存储与标准的基于行SQL Server不同。

As the name indicates, columnstore stores values in columns instead of in pages of rows with columns. This provides significantly increased performance when trying to fetch a sum of a column, or a distinct count – but takes a not so much when having to fetch an entire table.
To keep track of the values in each column, xVelocity uses a dictionary of unique values and an index of where the values are found. This can give a significant compression in the right circumstances.

顾名思义,columnstore将值存储在列中,而不是存储在具有列的行的页面中。 尝试获取列的总和或不同的计数时,这可以显着提高性能,但是在必须获取整个表时,所需的花费却不那么多。
为了跟踪每一列中的值,xVelocity使用唯一值的字典和找到值的位置的索引。 在适当的情况下,这可能会给您带来很大的压力。

Here’s a simple illustration of how this works:

这是它如何工作的简单说明:

There are several topics to consider when designing your model, I’ve grouped these into three areas ranging from the most basic – and where you gain the most effect to the more advanced and the effect varies more.

设计模型时,有几个主题需要考虑,我将这些主题分为三个区域,从最基本的到最有效的地方,再到最高级的地方,效果变化更大。

您的数据: (Your data: )

  1. Try having as few unique records in your columns as you can. In other words, avoid high granularity in your columns. The larger the column dictionary is, the less effective your compression is, and your memory usage increases.

    尝试在您的列中尽量减少唯一记录。 换句话说,请避免在列中使用高粒度。 列字典越大,压缩效果越差,并且内存使用量增加。

    Avoid DateTime columns, better to split time and date into two separate columns. Don’t store time down to milliseconds unless it’s really needed, and so on.

    避免使用DateTime列,最好将时间和日期分成两个单独的列。 除非确实需要,否则不要将时间存储到毫秒,依此类推。

  2. Just as low granularity helps, so does the sorting of the columns – the closer the unique values are to each other in your column the smaller the dictionary index is. However, it’s not possible to sort all columns perfectly – so you need to consider which column sorting gives the best result for you.

    就像低粒度一样,列的排序也有帮助-列中唯一值彼此越近,字典索引越小。 但是,不可能对所有列进行完美排序–因此,您需要考虑哪种列排序最适合您。

  3. Since the data is stored by column and not by row, you should never pull an entire table into your model if you aren’t going to use all the columns. Yes, you can always hide the column from view – but the data in those hidden columns will still fill up memory. I’ve seen tables with 30+ columns being pulled in, just so that the developer could use one single column from the table.

    由于数据是按列而不是按行存储的,因此,如果不打算使用所有列,则永远不要将整个表拉入模型。 是的,您始终可以从视图中隐藏该列-但这些隐藏列中的数据仍会填满内存。 我已经看到插入了30多个列的表,以使开发人员可以使用表中的单个列。

您的计算: (Your calculations:)

The calculation language of PowerPivot and Tabular – DAX – is a powerful language that lets you do all sorts of things with your data. You can calculate a running average, do simple distinct counts, add calculated columns to your tables and so on.

PowerPivot和Tabular的计算语言– DAX –是一种功能强大的语言,可让您对数据进行各种处理。 您可以计算移动平均值,进行简单的非重复计数,将计算出的列添加到表中等等。

This is all great, calculations are important and calculated columns lets you add functionality to your model quite easily, depending on your knowledge of DAX of course.

这一切都很好,计算很重要,并且计算列使您可以轻松地向模型添加功能,这当然取决于您对DAX的了解。

But, this comes with a price. Every calculation comes with a memory cost. For instance, on a small 5+ million row model – adding a simple «RELATED» column can add 2,5 MB to your model. And this will impact the performance of your cube. Therefore, when modeling your data, it’s important to consider exactly what you need to calculate in the model and what you can calculate before sending data to the model.

但是,这是有代价的。 每次计算都会带来内存成本。 例如,在一个5百万以上的小型行模型上,添加一个简单的“相关”列可以为您的模型增加2,5 MB。 这将影响多维数据集的性能。 因此,在对数据建模时,重要的是要仔细考虑在模型中需要计算的内容以及在将数据发送到模型之前可以计算的内容。

If you are using PowerPivot and not using PowerQuery, you are not using all your tools. PowerQuery is an excellent self-service ETL tool. And you can do a lot here.

如果您使用的是PowerPivot而不是PowerQuery,则说明您并未使用所有工具。 PowerQuery是出色的自助ETL工具。 您可以在这里做很多事情。

Likewise, if you are working with a Tabular model you will have access to both regular MS SQL Server as well as Integration Services. Both of which will let you do transformations and calculations that will be delivered ready for use in your model. And now it’ll be just regular data – taking no more memory or CPU than any of your other columns. Pulling entire tables into your model, just so you can use one column in a RELATED-formula in your fact table is a waste of resources. Add the column to your fact table before pulling it in instead.

同样,如果您使用表格模型,则可以访问常规的MS SQL Server以及Integration Services。 两者都可以让您进行转换和计算,以准备在模型中使用。 现在,它只是常规数据–占用的内存或CPU不超过其他任何列。 将整个表放入模型中,只是为了在事实表的RELATED公式中使用一列是浪费资源。 将该列添加到您的事实表中,然后再拉入。

事实和维度表: (Your Fact and Dimension tables:)

Now this is an area that you should consider more closely if you – after having tweaked both your data and your calculations – still see the need for tuning. This will also be a good place to look if you are inheriting a model someone else made.

现在,在调整数据和计算之后,如果仍然认为有必要进行调整,则应该更仔细地考虑这一领域。 如果您要继承别人制作的模型,那么这也是一个不错的地方。

It doesn’t always give the needed results, and sometimes you will trade off memory consumption for increased processing time. But it might be the right thing for you, so take it into consideration.

它并不总是能提供所需的结果,有时您会在内存消耗方面进行权衡以增加处理时间。 但这可能对您来说是正确的事情,因此请考虑在内。

Consider the following model

考虑以下模型

This a mostly standard snowflake schema – except for the six tables that are isolated from the rest – and do nothing. This is, of course, a total waste of memory. Remember to remove unused tables when you are done modeling.

这是一个最标准的雪花模式-除了与其余表隔离的六个表之外,什么也不做。 当然,这完全是浪费内存。 完成建模后,请记住删除未使用的表。

However, there are still quite a few dimensions here. And as mentioned earlier – dragging in an entire table to use only one column is a waste. Even if you drag in just two – one you want to use and then a link-column you might be better off merging this into either the fact table or into a related dimension. Every join and lookup will also take up some resources, and even if that seems minimal in the larger scale of things, it all adds up.

但是,这里仍然有很多尺寸。 如前所述,将整个表拖到只使用一列是一种浪费。 即使您只拖入两个-您要使用一个,然后拖入一个链接列,您最好将其合并到事实表或相关维中。 每次连接和查找也将占用一些资源,即使在较大规模的事情中看起来很少,也全部累加了。

To illustrate, here is a compact version of the same model as above:

为了说明这一点,这是与上述相同模型的紧凑版本:

Dimensions have been merged into either the fact table or dimension tables that contained much of the same information or similar information.

维度已合并到事实表或包含许多相同或相似信息的维度表中。

There are fewer jumps and the model performs well. A potential downside to this is that a large fact table can take longer to process, though it might perform better once it’s in memory. This is something that might be totally fine or a deal breaker. And it will be up to you to decide what is best in any given scenario.

跳跃少,模型运行良好。 潜在的不利因素是大型事实表可能需要更长的处理时间,尽管一旦将其存储在内存中可能会表现更好。 这可能完全没问题,或者破坏了交易。 在任何给定情况下,由您决定什么是最好的。

翻译自: https://www.sqlshack.com/performance-tuning-an-ssas-tabular-model/

ssas表格模型 权限控制


http://chatgpt.dhexx.cn/article/qfiwGS9J.shtml

相关文章

ssas从mysql获取数据库_SSAS-实用的DMV查询

以下查询,比较实用。 --All Cubes in database SELECT [CATALOG_NAME] AS [DATABASE],CUBE_CAPTION AS [CUBE/PERSPECTIVE],BASE_CUBE_NAME FROM $system.MDSchema_Cubes WHERE CUBE_SOURCE1 --All dimensions in Cube SELECT [CATALOG_NAME] as [DATABASE], CUBE_N…

ssas表格模型 权限控制_创建第一个SSAS表格模型数据库

ssas表格模型 权限控制 Considering BI environment, when comparing Multidimensional Vs Tabular model databases, both of them have their own advantages and purpose in data analytics and business intelligence. 考虑到BI环境,在比较多维VS表格模型数据库…

ssas 分层维度_通过SSAS维度层次结构增强数据分析

ssas 分层维度 介绍 (Introduction) This article will discuss how SSAS Dimension Hierarchies can be used to analyze data much efficiently. If you are a data analyst, you want to start the analysis with a higher hierarchy. Then navigate the narrow attributes …

ssas连接mysql_Web服务器(Websphere、Tomcat)使用olap4j连接多维数据库(Ssas)

最近项目需要使用Java连接到Sql Server多维数据库(Ssas)。在网上找到了一种通过可以通过IIS发布dll来作为jdbc连接串的方法,通过开源的olap4j的jar包,成功实现了类jdbc的方式连接到ssas。但实际应用中往往是通过web服务器的jdbc连接池的方式获得连接。 费…

ssas连接mysql_BI-SSAS简介篇

一、是什么? SSAS是用于SQLServer数据库用于BI的组件,通过SSAS可以创建多维数据库,并在之上进行数据挖掘操作。本文我们主要介绍一些关于SSAS数据分析的知识。接下来就让我们来一起了解一下吧。 商业智能提供的解决方案能够从多种数据源获取数…

ssas连接oracle性能,Analysis Services(SSAS) 性能优化

1、聚合选项中添加聚合,以空间换时间提升性能。 如下图: 性能提升百分比越高,聚合数越高,生成的Cube越大,这就是以空间换时间。 2、修改SSAS服务器上的线程池配置选项、提升并发数。 通过X:\Program Files\Microsoft S…

大数据时代:SSAS从入门到放弃

大数据时代到来,如何从数据中提取、挖掘对业务发展有价值的信息,为业务决策提供有力依据,推动精益化化的企业管理。商业分析师通常会使用各种数据分析工具,例如Excel、Tableau和PowerBI等对数据进行分析。OLAP就经常被用于对接这类…

ssas连接mysql_SSAS系列基础知识

1、什么是Cube? 简单 Cube 对象由基本信息、维度和度量值组组成。 基本信息包括多维数据集的名称、多维数据集的默认度量值、数据源和存储模式等。维度是多维数据集中使用的实际维度组。所有维度都必须先在数据库的维度集合中定义,然后才能在多维数据集中引用。度量…

SSAS多维数据分析创建

一、Visual Studio简介 Microsoft在 SQL Server Analysis Services (SSAS) 中,可以方便地创建复杂的联机分析处理(OLAP) 和数据挖掘解决方案。Analysis Services 工具提供了设计、创建和管理来自数据仓库的多维数据集和数据挖掘模型的功能,还提供对 OLAP…

SSAS介绍

文章提纲 商业智能(BI, Business Intelligence)基本概念 SSAS(SQL Server Analysis Services)相关工具(开发、管理和客户端) 总结 一、商业智能(BI, Business Intelli…

SSAS教程(一)——SSAS简介

SSAS全称SQL Server Analysis Services。Analysis Services 是在决策支持和商业分析中使用的分析数据引擎,它为商业报表和客户端应用程序提供了企业级语义数据模型,比如Power BI、 Excel、 Reporting Services 以及其他数据可视化工具。只要是支持Analys…

Java数组的初始化

Java数组初始化 1 一维数组初始化2 二维数组初始化 1 一维数组初始化 public class ArrayDemo1 {public static void main(String[] args) {// 格式一(动态初始化)int[] arr1 new int[3]; // 数组的长度(这里为3)必须指定// 格式二(静态初始化)int[] arr2 new int[]{1, 2, 3…

java类初始数组_java中数组初始化的三种方式是什么

java中数组初始化的三种方式是:1、静态初始化,如【int a[] {2, 0, 1, 9, 2020}】;2、动态初始化,如【int[] c new int[4]】;3、默认初始化,如【int[]dnew int[5]】。 初始化方式: 1、静态初始…

Java数组初始化、赋值与输出

文章目录 Java数组相关知识数组初始化一维数组二维数组 数组输出一维数组二维数组 Java数组相关知识 数组初始化 一维数组 初始化为0 int[] a; a new int[5]; int[] b new int[5]; 初始化为指定值 int[] a new int[]{0,1,2,3,4};//正确 int[] b {0,1,2,3,4};//正确&a…

java初始化array_java数组初始化方式

在使用一个新的数组之前,要先对其中的数值进行设置,也就是我们常说的初始化工作。因为数组有长度和内容的区分,所以常见的两种初始化方法是动态和静态,另外一种就是默认初始化。下面我们对数组的初始化概念进行理解,区…

c++ lamuda表达式mutable

1.lambda表达式 C11引入了Lambda表达式。Lambda表达式的引入,方便了简短函数的定义,为常用的一次性函数的定义和使用提供了很大的便利。 Lambda表达式实际上是一种匿名函数定义,常用来定义简单和不重复使用的函数。其可使用的外部变量、定义方…

const和mutable关键字

const修饰变量表示改变量内容不可修改,在类中,const还可以修饰成员函数,修饰成员函数后就不可以更改成员变量了。 可以看出,this指针是const*const类型,既不可以修改其内容,也不能修改其指向。 想一下&…

C++的mutable

一、介绍 mutable的中文意思是“可变的,易变的”,正好与const相反。在C中,mutable也是为了突破const的限制而设置的。被mutable修饰的变量,将永远处于可变的状态,即使在一个const函数中。 二、用法 如果类的成员函数…

Scala集合的mutable和immutable解释

Scala集合的mutable和immutable解释 概述集合API概述 概述 Scala 集合类系统地区分了可变的和不可变的集合。可变集合可以在适当的地方被更新或扩展。这意味着你可以修改,添加,移除一个集合的元素。而不可变集合类,相比之下,永远不…

C++之mutable

mutable大概两种用法 第一种,若想在GetName中对一个私有成员变量进行更改,那么只能将其设置为mutable. class test { private:std::string m_name;mutable int m_count; public:const std::string & GetName() const{m_count;return m_name;} };…