Calculated Columns in SSAS

Not too long ago, we had major issues with one of our tabular models, when measures became so resource intensive, that they crashed the whole server. Needless to say that the admins weren’t too happy about that, so we tried to figure out how to improve. The problem itself was obvious: a complex calculation inside a measure was draining the CPU like there was no tomorrow. Only problem: Our procedures were so bad, that reloading all partitions would have taken ages. We fixed the problem with a calculated column and for us, everything was fine.

As the solution grew older, more data was flowing and the issues started again. Long story short, pumping data into this model was slow as hell and we were all wondering why. After all, refreshing partitions with about a million rows shouldn’t take very long, especially when it’s a simple select. Obviously there was something wrong with calculated columns and so I made a few tests.

So let’s see what happens if we use calculated columns First of all we need a small tabular based on the AdventureWorks DB. One table with four partitions, each of them one year of FactResellerSales, that’s all you need. With the version I’m using that’s about a million rows per partition, so loading the data won’t take long. SSAS will create all files and voilĂ , your model is ready. Before we start doing anything, let’s do a refresh of a single partition, because that’s where the problems started (I know, the dates will betray me, I forgot that step the first time). What we want to check is, which files have been changed. After all, the tabular model persists everything into multiple files on the disc.

FileLastWrittenFileSizeKB
H$ResellerSales (10)$DueDate (23)$(1212).tbl01.05.2022 03:14
H$ResellerSales (10)$ExtendedAmount (18)$(1127).tbl01.05.2022 03:14
H$ResellerSales (10)$OrderDate (22)$(1195).tbl01.05.2022 03:14
H$ResellerSales (10)$OrderQuantity (16)$(1093).tbl01.05.2022 03:14
H$ResellerSales (10)$ProductKey (14)$(1059).tbl01.05.2022 03:14
H$ResellerSales (10)$ProductStandardCost (19)$(1144).tbl01.05.2022 03:14
H$ResellerSales (10)$SalesAmount (21)$(1178).tbl01.05.2022 03:14
H$ResellerSales (10)$SalesOrderNumber (15)$(1076).tbl01.05.2022 03:14
H$ResellerSales (10)$ShipDate (24)$(1229).tbl01.05.2022 03:14
H$ResellerSales (10)$TotalProductCost (20)$(1161).tbl01.05.2022 03:14
H$ResellerSales (10)$UnitPrice (17)$(1110).tbl01.05.2022 03:14
ResellerSales (10).tbl01.05.2022 03:14
0.CryptKey.bin29.04.2022 01:021
metadata.sqlitedb01.05.2022 03:1497
H$ResellerSales (10)$DueDate (23)$(1212).tbl\1215.prt01.05.2022 03:14
H$ResellerSales (10)$DueDate (23)$(1212).tbl\1215.prt\7.H$ResellerSales (10)$DueDate (23).ID_TO_POS.0.idf01.05.2022 03:146
H$ResellerSales (10)$DueDate (23)$(1212).tbl\1215.prt\7.H$ResellerSales (10)$DueDate (23).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$DueDate (23)$(1212).tbl\1215.prt\7.H$ResellerSales (10)$DueDate (23).POS_TO_ID.0.idf01.05.2022 03:146
H$ResellerSales (10)$DueDate (23)$(1212).tbl\1215.prt\7.H$ResellerSales (10)$DueDate (23).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ExtendedAmount (18)$(1127).tbl\1130.prt01.05.2022 03:14
H$ResellerSales (10)$ExtendedAmount (18)$(1127).tbl\1130.prt\7.H$ResellerSales (10)$ExtendedAmount (18).ID_TO_POS.0.idf01.05.2022 03:1424
H$ResellerSales (10)$ExtendedAmount (18)$(1127).tbl\1130.prt\7.H$ResellerSales (10)$ExtendedAmount (18).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ExtendedAmount (18)$(1127).tbl\1130.prt\7.H$ResellerSales (10)$ExtendedAmount (18).POS_TO_ID.0.idf01.05.2022 03:1424
H$ResellerSales (10)$ExtendedAmount (18)$(1127).tbl\1130.prt\7.H$ResellerSales (10)$ExtendedAmount (18).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$OrderDate (22)$(1195).tbl\1198.prt01.05.2022 03:14
H$ResellerSales (10)$OrderDate (22)$(1195).tbl\1198.prt\7.H$ResellerSales (10)$OrderDate (22).ID_TO_POS.0.idf01.05.2022 03:146
H$ResellerSales (10)$OrderDate (22)$(1195).tbl\1198.prt\7.H$ResellerSales (10)$OrderDate (22).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$OrderDate (22)$(1195).tbl\1198.prt\7.H$ResellerSales (10)$OrderDate (22).POS_TO_ID.0.idf01.05.2022 03:146
H$ResellerSales (10)$OrderDate (22)$(1195).tbl\1198.prt\7.H$ResellerSales (10)$OrderDate (22).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$OrderQuantity (16)$(1093).tbl\1096.prt01.05.2022 03:14
H$ResellerSales (10)$OrderQuantity (16)$(1093).tbl\1096.prt\7.H$ResellerSales (10)$OrderQuantity (16).ID_TO_POS.0.idf01.05.2022 03:141
H$ResellerSales (10)$OrderQuantity (16)$(1093).tbl\1096.prt\7.H$ResellerSales (10)$OrderQuantity (16).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$OrderQuantity (16)$(1093).tbl\1096.prt\7.H$ResellerSales (10)$OrderQuantity (16).POS_TO_ID.0.idf01.05.2022 03:141
H$ResellerSales (10)$OrderQuantity (16)$(1093).tbl\1096.prt\7.H$ResellerSales (10)$OrderQuantity (16).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ProductKey (14)$(1059).tbl\1062.prt01.05.2022 03:14
H$ResellerSales (10)$ProductKey (14)$(1059).tbl\1062.prt\7.H$ResellerSales (10)$ProductKey (14).ID_TO_POS.0.idf01.05.2022 03:142
H$ResellerSales (10)$ProductKey (14)$(1059).tbl\1062.prt\7.H$ResellerSales (10)$ProductKey (14).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ProductKey (14)$(1059).tbl\1062.prt\7.H$ResellerSales (10)$ProductKey (14).POS_TO_ID.0.idf01.05.2022 03:142
H$ResellerSales (10)$ProductKey (14)$(1059).tbl\1062.prt\7.H$ResellerSales (10)$ProductKey (14).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ProductStandardCost (19)$(1144).tbl\1147.prt01.05.2022 03:14
H$ResellerSales (10)$ProductStandardCost (19)$(1144).tbl\1147.prt\7.H$ResellerSales (10)$ProductStandardCost (19).ID_TO_POS.0.idf01.05.2022 03:141
H$ResellerSales (10)$ProductStandardCost (19)$(1144).tbl\1147.prt\7.H$ResellerSales (10)$ProductStandardCost (19).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ProductStandardCost (19)$(1144).tbl\1147.prt\7.H$ResellerSales (10)$ProductStandardCost (19).POS_TO_ID.0.idf01.05.2022 03:141
H$ResellerSales (10)$ProductStandardCost (19)$(1144).tbl\1147.prt\7.H$ResellerSales (10)$ProductStandardCost (19).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$SalesAmount (21)$(1178).tbl\1181.prt01.05.2022 03:14
H$ResellerSales (10)$SalesAmount (21)$(1178).tbl\1181.prt\7.H$ResellerSales (10)$SalesAmount (21).ID_TO_POS.0.idf01.05.2022 03:1417
H$ResellerSales (10)$SalesAmount (21)$(1178).tbl\1181.prt\7.H$ResellerSales (10)$SalesAmount (21).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$SalesAmount (21)$(1178).tbl\1181.prt\7.H$ResellerSales (10)$SalesAmount (21).POS_TO_ID.0.idf01.05.2022 03:1417
H$ResellerSales (10)$SalesAmount (21)$(1178).tbl\1181.prt\7.H$ResellerSales (10)$SalesAmount (21).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$SalesOrderNumber (15)$(1076).tbl\1079.prt01.05.2022 03:14
H$ResellerSales (10)$SalesOrderNumber (15)$(1076).tbl\1079.prt\7.H$ResellerSales (10)$SalesOrderNumber (15).ID_TO_POS.0.idf01.05.2022 03:142651
H$ResellerSales (10)$SalesOrderNumber (15)$(1076).tbl\1079.prt\7.H$ResellerSales (10)$SalesOrderNumber (15).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$SalesOrderNumber (15)$(1076).tbl\1079.prt\7.H$ResellerSales (10)$SalesOrderNumber (15).POS_TO_ID.0.idf01.05.2022 03:142651
H$ResellerSales (10)$SalesOrderNumber (15)$(1076).tbl\1079.prt\7.H$ResellerSales (10)$SalesOrderNumber (15).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ShipDate (24)$(1229).tbl\1232.prt01.05.2022 03:14
H$ResellerSales (10)$ShipDate (24)$(1229).tbl\1232.prt\7.H$ResellerSales (10)$ShipDate (24).ID_TO_POS.0.idf01.05.2022 03:146
H$ResellerSales (10)$ShipDate (24)$(1229).tbl\1232.prt\7.H$ResellerSales (10)$ShipDate (24).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$ShipDate (24)$(1229).tbl\1232.prt\7.H$ResellerSales (10)$ShipDate (24).POS_TO_ID.0.idf01.05.2022 03:146
H$ResellerSales (10)$ShipDate (24)$(1229).tbl\1232.prt\7.H$ResellerSales (10)$ShipDate (24).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$TotalProductCost (20)$(1161).tbl\1164.prt01.05.2022 03:14
H$ResellerSales (10)$TotalProductCost (20)$(1161).tbl\1164.prt\7.H$ResellerSales (10)$TotalProductCost (20).ID_TO_POS.0.idf01.05.2022 03:144
H$ResellerSales (10)$TotalProductCost (20)$(1161).tbl\1164.prt\7.H$ResellerSales (10)$TotalProductCost (20).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$TotalProductCost (20)$(1161).tbl\1164.prt\7.H$ResellerSales (10)$TotalProductCost (20).POS_TO_ID.0.idf01.05.2022 03:144
H$ResellerSales (10)$TotalProductCost (20)$(1161).tbl\1164.prt\7.H$ResellerSales (10)$TotalProductCost (20).POS_TO_ID.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$UnitPrice (17)$(1110).tbl\1113.prt01.05.2022 03:14
H$ResellerSales (10)$UnitPrice (17)$(1110).tbl\1113.prt\7.H$ResellerSales (10)$UnitPrice (17).ID_TO_POS.0.idf01.05.2022 03:145
H$ResellerSales (10)$UnitPrice (17)$(1110).tbl\1113.prt\7.H$ResellerSales (10)$UnitPrice (17).ID_TO_POS.0.idfmeta01.05.2022 03:141
H$ResellerSales (10)$UnitPrice (17)$(1110).tbl\1113.prt\7.H$ResellerSales (10)$UnitPrice (17).POS_TO_ID.0.idf01.05.2022 03:145
H$ResellerSales (10)$UnitPrice (17)$(1110).tbl\1113.prt\7.H$ResellerSales (10)$UnitPrice (17).POS_TO_ID.0.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\25.prt01.05.2022 03:14
ResellerSales (10).tbl\26.prt01.05.2022 03:14
ResellerSales (10).tbl\27.prt01.05.2022 03:14
ResellerSales (10).tbl\28.prt01.05.2022 03:14
ResellerSales (10).tbl\8.ResellerSales (10).DueDate (23).dictionary01.05.2022 03:1412
ResellerSales (10).tbl\8.ResellerSales (10).ExtendedAmount (18).dictionary01.05.2022 03:1448
ResellerSales (10).tbl\8.ResellerSales (10).OrderDate (22).dictionary01.05.2022 03:1412
ResellerSales (10).tbl\8.ResellerSales (10).OrderQuantity (16).dictionary01.05.2022 03:141
ResellerSales (10).tbl\8.ResellerSales (10).ProductKey (14).dictionary01.05.2022 03:142
ResellerSales (10).tbl\8.ResellerSales (10).ProductStandardCost (19).dictionary01.05.2022 03:142
ResellerSales (10).tbl\8.ResellerSales (10).SalesAmount (21).dictionary01.05.2022 03:1433
ResellerSales (10).tbl\8.ResellerSales (10).SalesOrderNumber (15).dictionary01.05.2022 03:147890
ResellerSales (10).tbl\8.ResellerSales (10).ShipDate (24).dictionary01.05.2022 03:1412
ResellerSales (10).tbl\8.ResellerSales (10).TotalProductCost (20).dictionary01.05.2022 03:147
ResellerSales (10).tbl\8.ResellerSales (10).UnitPrice (17).dictionary01.05.2022 03:1410
ResellerSales (10).tbl\25.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).0.idf01.05.2022 03:141
ResellerSales (10).tbl\25.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).0.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\26.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).1.idf01.05.2022 03:141
ResellerSales (10).tbl\26.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).1.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\27.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).2.idf01.05.2022 03:141
ResellerSales (10).tbl\27.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).2.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).DueDate (23).3.idf01.05.2022 03:141291
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).DueDate (23).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ExtendedAmount (18).3.idf01.05.2022 03:14223
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ExtendedAmount (18).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).OrderDate (22).3.idf01.05.2022 03:141291
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).OrderDate (22).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).OrderQuantity (16).3.idf01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).OrderQuantity (16).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ProductKey (14).3.idf01.05.2022 03:14219
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ProductKey (14).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ProductStandardCost (19).3.idf01.05.2022 03:1435
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ProductStandardCost (19).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).3.idf01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).SalesAmount (21).3.idf01.05.2022 03:14170
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).SalesAmount (21).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).SalesOrderNumber (15).3.idf01.05.2022 03:143081
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).SalesOrderNumber (15).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ShipDate (24).3.idf01.05.2022 03:141291
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).ShipDate (24).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).TotalProductCost (20).3.idf01.05.2022 03:1444
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).TotalProductCost (20).3.idfmeta01.05.2022 03:141
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).UnitPrice (17).3.idf01.05.2022 03:14192
ResellerSales (10).tbl\28.prt\8.ResellerSales (10).UnitPrice (17).3.idfmeta01.05.2022 03:141

So these are a lot of files that have been changed, but let’s split that into categories. First of all, the system hierarchies – starting with H$ – have all been rebuilt. This shouldn’t be too much of a surprise, since the system needs to know which values have been added. Same is true for the dictionaries. What surprised me a bit was that although only one partition was loaded (28.prt), all row numbers were updated. The last part is the partition itself. The above is what the regular processing of a single partition will look like.

So let’s proceed to adding a calculated column. Personally I’m using PowerShell to add them, but use whatever you like best. This is the code I’m using:

Import-Module SqlServer;

$server = New-Object Microsoft.AnalysisServices.Tabular.Server;
$server.Connect("APOC\DEV_TAB");

$database = $server.Databases["CalculatedColumnTest"];
$model = $database.Model;
$table = $model.Tables["ResellerSales"];

$table.Columns.Add(
    (New-Object Microsoft.AnalysisServices.Tabular.CalculatedColumn -Property @{
        Name = "CalcCol";
        Expression = "[OrderQuantity] * [UnitPrice]";
    })
);

$model.SaveChanges();

Now that we added the column, let’s see which files have been changed.

FileLastWrittenFileSizeKB
metadata.sqlitedb29.04.2022 01:3290
ResellerSales (10).tbl\25.prt29.04.2022 01:32
ResellerSales (10).tbl\26.prt29.04.2022 01:32
ResellerSales (10).tbl\27.prt29.04.2022 01:32
ResellerSales (10).tbl\28.prt29.04.2022 01:32
ResellerSales (10).tbl\25.prt\2.ResellerSales (10).CalcCol (533).0.idf29.04.2022 01:321
ResellerSales (10).tbl\25.prt\2.ResellerSales (10).CalcCol (533).0.idfmeta29.04.2022 01:321
ResellerSales (10).tbl\26.prt\2.ResellerSales (10).CalcCol (533).1.idf29.04.2022 01:321
ResellerSales (10).tbl\26.prt\2.ResellerSales (10).CalcCol (533).1.idfmeta29.04.2022 01:321
ResellerSales (10).tbl\27.prt\2.ResellerSales (10).CalcCol (533).2.idf29.04.2022 01:321
ResellerSales (10).tbl\27.prt\2.ResellerSales (10).CalcCol (533).2.idfmeta29.04.2022 01:321
ResellerSales (10).tbl\28.prt\2.ResellerSales (10).CalcCol (533).3.idf29.04.2022 01:321
ResellerSales (10).tbl\28.prt\2.ResellerSales (10).CalcCol (533).3.idfmeta29.04.2022 01:321

This is pretty much what you would expect, given that the column has only been created and no refresh has been done. The folders have been changed and the files for the calculated column have been created. You can see they’re still empty, since their file size is 1. Of course we don’t want an empty column, so let’s refresh that thing:

$model.RequestRefresh("Calculate");
$model.SaveChanges();

The outcome we get now is not really surprising, as well.

FileLastWrittenFileSizeKB
H$ResellerSales (10)$CalcCol (533)$(554).tbl29.04.2022 01:54
ResellerSales (10).tbl29.04.2022 01:54
metadata.sqlitedb29.04.2022 01:5493
H$ResellerSales (10)$CalcCol (533)$(554).tbl\557.prt29.04.2022 01:54
H$ResellerSales (10)$CalcCol (533)$(554).tbl\557.prt\0.H$ResellerSales (10)$CalcCol (533).ID_TO_POS.0.idf29.04.2022 01:5426
H$ResellerSales (10)$CalcCol (533)$(554).tbl\557.prt\0.H$ResellerSales (10)$CalcCol (533).ID_TO_POS.0.idfmeta29.04.2022 01:541
H$ResellerSales (10)$CalcCol (533)$(554).tbl\557.prt\0.H$ResellerSales (10)$CalcCol (533).POS_TO_ID.0.idf29.04.2022 01:5426
H$ResellerSales (10)$CalcCol (533)$(554).tbl\557.prt\0.H$ResellerSales (10)$CalcCol (533).POS_TO_ID.0.idfmeta29.04.2022 01:541
ResellerSales (10).tbl\25.prt29.04.2022 01:54
ResellerSales (10).tbl\26.prt29.04.2022 01:54
ResellerSales (10).tbl\27.prt29.04.2022 01:54
ResellerSales (10).tbl\28.prt29.04.2022 01:54
ResellerSales (10).tbl\4.ResellerSales (10).CalcCol (533).dictionary29.04.2022 01:5451
ResellerSales (10).tbl\25.prt\4.ResellerSales (10).CalcCol (533).0.idf29.04.2022 01:5418
ResellerSales (10).tbl\25.prt\4.ResellerSales (10).CalcCol (533).0.idfmeta29.04.2022 01:541
ResellerSales (10).tbl\26.prt\4.ResellerSales (10).CalcCol (533).1.idf29.04.2022 01:54207
ResellerSales (10).tbl\26.prt\4.ResellerSales (10).CalcCol (533).1.idfmeta29.04.2022 01:541
ResellerSales (10).tbl\27.prt\4.ResellerSales (10).CalcCol (533).2.idf29.04.2022 01:54218
ResellerSales (10).tbl\27.prt\4.ResellerSales (10).CalcCol (533).2.idfmeta29.04.2022 01:541
ResellerSales (10).tbl\28.prt\4.ResellerSales (10).CalcCol (533).3.idf29.04.2022 01:54223
ResellerSales (10).tbl\28.prt\4.ResellerSales (10).CalcCol (533).3.idfmeta29.04.2022 01:541

The hierarchy has been updated for the new column and the column itself has been filled on all four partitions. Now onwards to the final step. If you model is very large, you will try everything to keep the load as short as possible without touching too many tables or partitions. This is why partitions exist and this is how our initial scenario started. So let’s go and do exactly that, refresh a single partition.

$table.Partitions["2013"].RequestRefresh("Full");
$model.SaveChanges();

What happens now was a surprise to me (well I guess not only to me, otherwise the problem would’ve never arisen). Let’s see which files have been changed now. For easier navigation I have added a column to allow filtering.

FileLastWrittenFileSizeKBPartition
H$ResellerSales (10)$CalcCol (533)$(763).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$DueDate (23)$(729).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ExtendedAmount (18)$(644).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$OrderDate (22)$(712).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$OrderQuantity (16)$(610).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ProductKey (14)$(576).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ProductStandardCost (19)$(661).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$SalesAmount (21)$(695).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$SalesOrderNumber (15)$(593).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ShipDate (24)$(746).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$TotalProductCost (20)$(678).tbl29.04.2022 01:57Hierarchy
H$ResellerSales (10)$UnitPrice (17)$(627).tbl29.04.2022 01:57Hierarchy
ResellerSales (10).tbl29.04.2022 01:57Hierarchy
metadata.sqlitedb29.04.2022 01:5795Hierarchy
H$ResellerSales (10)$CalcCol (533)$(763).tbl\766.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$CalcCol (533)$(763).tbl\766.prt\3.H$ResellerSales (10)$CalcCol (533).ID_TO_POS.0.idf29.04.2022 01:5726Hierarchy
H$ResellerSales (10)$CalcCol (533)$(763).tbl\766.prt\3.H$ResellerSales (10)$CalcCol (533).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$CalcCol (533)$(763).tbl\766.prt\3.H$ResellerSales (10)$CalcCol (533).POS_TO_ID.0.idf29.04.2022 01:5726Hierarchy
H$ResellerSales (10)$CalcCol (533)$(763).tbl\766.prt\3.H$ResellerSales (10)$CalcCol (533).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$DueDate (23)$(729).tbl\732.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$DueDate (23)$(729).tbl\732.prt\3.H$ResellerSales (10)$DueDate (23).ID_TO_POS.0.idf29.04.2022 01:576Hierarchy
H$ResellerSales (10)$DueDate (23)$(729).tbl\732.prt\3.H$ResellerSales (10)$DueDate (23).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$DueDate (23)$(729).tbl\732.prt\3.H$ResellerSales (10)$DueDate (23).POS_TO_ID.0.idf29.04.2022 01:576Hierarchy
H$ResellerSales (10)$DueDate (23)$(729).tbl\732.prt\3.H$ResellerSales (10)$DueDate (23).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ExtendedAmount (18)$(644).tbl\647.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ExtendedAmount (18)$(644).tbl\647.prt\3.H$ResellerSales (10)$ExtendedAmount (18).ID_TO_POS.0.idf29.04.2022 01:5724Hierarchy
H$ResellerSales (10)$ExtendedAmount (18)$(644).tbl\647.prt\3.H$ResellerSales (10)$ExtendedAmount (18).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ExtendedAmount (18)$(644).tbl\647.prt\3.H$ResellerSales (10)$ExtendedAmount (18).POS_TO_ID.0.idf29.04.2022 01:5724Hierarchy
H$ResellerSales (10)$ExtendedAmount (18)$(644).tbl\647.prt\3.H$ResellerSales (10)$ExtendedAmount (18).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$OrderDate (22)$(712).tbl\715.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$OrderDate (22)$(712).tbl\715.prt\3.H$ResellerSales (10)$OrderDate (22).ID_TO_POS.0.idf29.04.2022 01:576Hierarchy
H$ResellerSales (10)$OrderDate (22)$(712).tbl\715.prt\3.H$ResellerSales (10)$OrderDate (22).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$OrderDate (22)$(712).tbl\715.prt\3.H$ResellerSales (10)$OrderDate (22).POS_TO_ID.0.idf29.04.2022 01:576Hierarchy
H$ResellerSales (10)$OrderDate (22)$(712).tbl\715.prt\3.H$ResellerSales (10)$OrderDate (22).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$OrderQuantity (16)$(610).tbl\613.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$OrderQuantity (16)$(610).tbl\613.prt\3.H$ResellerSales (10)$OrderQuantity (16).ID_TO_POS.0.idf29.04.2022 01:571Hierarchy
H$ResellerSales (10)$OrderQuantity (16)$(610).tbl\613.prt\3.H$ResellerSales (10)$OrderQuantity (16).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$OrderQuantity (16)$(610).tbl\613.prt\3.H$ResellerSales (10)$OrderQuantity (16).POS_TO_ID.0.idf29.04.2022 01:571Hierarchy
H$ResellerSales (10)$OrderQuantity (16)$(610).tbl\613.prt\3.H$ResellerSales (10)$OrderQuantity (16).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ProductKey (14)$(576).tbl\579.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ProductKey (14)$(576).tbl\579.prt\3.H$ResellerSales (10)$ProductKey (14).ID_TO_POS.0.idf29.04.2022 01:572Hierarchy
H$ResellerSales (10)$ProductKey (14)$(576).tbl\579.prt\3.H$ResellerSales (10)$ProductKey (14).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ProductKey (14)$(576).tbl\579.prt\3.H$ResellerSales (10)$ProductKey (14).POS_TO_ID.0.idf29.04.2022 01:572Hierarchy
H$ResellerSales (10)$ProductKey (14)$(576).tbl\579.prt\3.H$ResellerSales (10)$ProductKey (14).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ProductStandardCost (19)$(661).tbl\664.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ProductStandardCost (19)$(661).tbl\664.prt\3.H$ResellerSales (10)$ProductStandardCost (19).ID_TO_POS.0.idf29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ProductStandardCost (19)$(661).tbl\664.prt\3.H$ResellerSales (10)$ProductStandardCost (19).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ProductStandardCost (19)$(661).tbl\664.prt\3.H$ResellerSales (10)$ProductStandardCost (19).POS_TO_ID.0.idf29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ProductStandardCost (19)$(661).tbl\664.prt\3.H$ResellerSales (10)$ProductStandardCost (19).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$SalesAmount (21)$(695).tbl\698.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$SalesAmount (21)$(695).tbl\698.prt\3.H$ResellerSales (10)$SalesAmount (21).ID_TO_POS.0.idf29.04.2022 01:5717Hierarchy
H$ResellerSales (10)$SalesAmount (21)$(695).tbl\698.prt\3.H$ResellerSales (10)$SalesAmount (21).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$SalesAmount (21)$(695).tbl\698.prt\3.H$ResellerSales (10)$SalesAmount (21).POS_TO_ID.0.idf29.04.2022 01:5717Hierarchy
H$ResellerSales (10)$SalesAmount (21)$(695).tbl\698.prt\3.H$ResellerSales (10)$SalesAmount (21).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$SalesOrderNumber (15)$(593).tbl\596.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$SalesOrderNumber (15)$(593).tbl\596.prt\3.H$ResellerSales (10)$SalesOrderNumber (15).ID_TO_POS.0.idf29.04.2022 01:572651Hierarchy
H$ResellerSales (10)$SalesOrderNumber (15)$(593).tbl\596.prt\3.H$ResellerSales (10)$SalesOrderNumber (15).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$SalesOrderNumber (15)$(593).tbl\596.prt\3.H$ResellerSales (10)$SalesOrderNumber (15).POS_TO_ID.0.idf29.04.2022 01:572651Hierarchy
H$ResellerSales (10)$SalesOrderNumber (15)$(593).tbl\596.prt\3.H$ResellerSales (10)$SalesOrderNumber (15).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ShipDate (24)$(746).tbl\749.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$ShipDate (24)$(746).tbl\749.prt\3.H$ResellerSales (10)$ShipDate (24).ID_TO_POS.0.idf29.04.2022 01:576Hierarchy
H$ResellerSales (10)$ShipDate (24)$(746).tbl\749.prt\3.H$ResellerSales (10)$ShipDate (24).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$ShipDate (24)$(746).tbl\749.prt\3.H$ResellerSales (10)$ShipDate (24).POS_TO_ID.0.idf29.04.2022 01:576Hierarchy
H$ResellerSales (10)$ShipDate (24)$(746).tbl\749.prt\3.H$ResellerSales (10)$ShipDate (24).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$TotalProductCost (20)$(678).tbl\681.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$TotalProductCost (20)$(678).tbl\681.prt\3.H$ResellerSales (10)$TotalProductCost (20).ID_TO_POS.0.idf29.04.2022 01:574Hierarchy
H$ResellerSales (10)$TotalProductCost (20)$(678).tbl\681.prt\3.H$ResellerSales (10)$TotalProductCost (20).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$TotalProductCost (20)$(678).tbl\681.prt\3.H$ResellerSales (10)$TotalProductCost (20).POS_TO_ID.0.idf29.04.2022 01:574Hierarchy
H$ResellerSales (10)$TotalProductCost (20)$(678).tbl\681.prt\3.H$ResellerSales (10)$TotalProductCost (20).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$UnitPrice (17)$(627).tbl\630.prt29.04.2022 01:57Hierarchy
H$ResellerSales (10)$UnitPrice (17)$(627).tbl\630.prt\3.H$ResellerSales (10)$UnitPrice (17).ID_TO_POS.0.idf29.04.2022 01:575Hierarchy
H$ResellerSales (10)$UnitPrice (17)$(627).tbl\630.prt\3.H$ResellerSales (10)$UnitPrice (17).ID_TO_POS.0.idfmeta29.04.2022 01:571Hierarchy
H$ResellerSales (10)$UnitPrice (17)$(627).tbl\630.prt\3.H$ResellerSales (10)$UnitPrice (17).POS_TO_ID.0.idf29.04.2022 01:575Hierarchy
H$ResellerSales (10)$UnitPrice (17)$(627).tbl\630.prt\3.H$ResellerSales (10)$UnitPrice (17).POS_TO_ID.0.idfmeta29.04.2022 01:571Hierarchy
ResellerSales (10).tbl\25.prt29.04.2022 01:5725.prt (2010)
ResellerSales (10).tbl\26.prt29.04.2022 01:5726.prt (2011)
ResellerSales (10).tbl\27.prt29.04.2022 01:5727.prt (2012)
ResellerSales (10).tbl\28.prt29.04.2022 01:5728.prt (2013)
ResellerSales (10).tbl\5.ResellerSales (10).CalcCol (533).dictionary29.04.2022 01:5751Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).DueDate (23).dictionary29.04.2022 01:5712Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).ExtendedAmount (18).dictionary29.04.2022 01:5748Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).OrderDate (22).dictionary29.04.2022 01:5712Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).OrderQuantity (16).dictionary29.04.2022 01:571Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).ProductKey (14).dictionary29.04.2022 01:572Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).ProductStandardCost (19).dictionary29.04.2022 01:572Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).SalesAmount (21).dictionary29.04.2022 01:5733Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).SalesOrderNumber (15).dictionary29.04.2022 01:577889Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).ShipDate (24).dictionary29.04.2022 01:5712Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).TotalProductCost (20).dictionary29.04.2022 01:577Dictionary
ResellerSales (10).tbl\5.ResellerSales (10).UnitPrice (17).dictionary29.04.2022 01:5710Dictionary
ResellerSales (10).tbl\25.prt\5.ResellerSales (10).CalcCol (533).0.idf29.04.2022 01:571825.prt (2010)
ResellerSales (10).tbl\25.prt\5.ResellerSales (10).CalcCol (533).0.idfmeta29.04.2022 01:57125.prt (2010)
ResellerSales (10).tbl\25.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).0.idf29.04.2022 01:57125.prt (2010)
ResellerSales (10).tbl\25.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).0.idfmeta29.04.2022 01:57125.prt (2010)
ResellerSales (10).tbl\26.prt\5.ResellerSales (10).CalcCol (533).1.idf29.04.2022 01:5720726.prt (2011)
ResellerSales (10).tbl\26.prt\5.ResellerSales (10).CalcCol (533).1.idfmeta29.04.2022 01:57126.prt (2011)
ResellerSales (10).tbl\26.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).1.idf29.04.2022 01:57126.prt (2011)
ResellerSales (10).tbl\26.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).1.idfmeta29.04.2022 01:57126.prt (2011)
ResellerSales (10).tbl\27.prt\5.ResellerSales (10).CalcCol (533).2.idf29.04.2022 01:5721827.prt (2012)
ResellerSales (10).tbl\27.prt\5.ResellerSales (10).CalcCol (533).2.idfmeta29.04.2022 01:57127.prt (2012)
ResellerSales (10).tbl\27.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).2.idf29.04.2022 01:57127.prt (2012)
ResellerSales (10).tbl\27.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).2.idfmeta29.04.2022 01:57127.prt (2012)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).CalcCol (533).3.idf29.04.2022 01:5722328.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).CalcCol (533).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).DueDate (23).3.idf29.04.2022 01:57180728.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).DueDate (23).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ExtendedAmount (18).3.idf29.04.2022 01:5722328.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ExtendedAmount (18).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).OrderDate (22).3.idf29.04.2022 01:57180728.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).OrderDate (22).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).OrderQuantity (16).3.idf29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).OrderQuantity (16).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ProductKey (14).3.idf29.04.2022 01:5721928.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ProductKey (14).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ProductStandardCost (19).3.idf29.04.2022 01:573528.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ProductStandardCost (19).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).3.idf29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).RowNumber 2662979B 1795 4F74 8F37 6A1BA8059B61 (11).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).SalesAmount (21).3.idf29.04.2022 01:5717028.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).SalesAmount (21).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).SalesOrderNumber (15).3.idf29.04.2022 01:57308128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).SalesOrderNumber (15).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ShipDate (24).3.idf29.04.2022 01:57180728.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).ShipDate (24).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).TotalProductCost (20).3.idf29.04.2022 01:574428.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).TotalProductCost (20).3.idfmeta29.04.2022 01:57128.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).UnitPrice (17).3.idf29.04.2022 01:5719228.prt (2013)
ResellerSales (10).tbl\28.prt\5.ResellerSales (10).UnitPrice (17).3.idfmeta29.04.2022 01:57128.prt (2013)

Obviously the partition we requested the refresh for (28.prt = 2013) was fully loaded, no surprise here. Additionally, all hierarchies and all row numbers were rebuilt. We saw that already, it’s required since there is new data incoming. Now to the costly part. As you can see, not only were the row numbers rebuilt for each partition, but so was the calculated column. In my opinion a strange behaviour. Yes, the formulas might contain references to data that has just been loaded, but it’s kind of strange that the engine doesn’t do a probe first, like checking whether the calculated column contains aggreation formulas.

Fact is, the more complex your calculated column gets and the more partitions you have, the longer it will take to perform a refresh, even if only a single partition one. At the end of the day you’re compromising a mechanic that you thought would give you an advantage in terms of refresh speed.

Does this mean that calculated columns are bad and should be avoided? My personal opinion: it depends, but rather yes. In the end it boils down to what you’re trying to achieve.

  • Do you need to change the model without reloading partitions? Then yes, this might be a good way to go, maybe even just for a while.
  • Is your model small enough and loads quickly? No problem, but then again, you might as well change the SQL and reload the whole thing, since it’s so fast.

What do you think about calculated columns. Are they a blessing of heaven or are they a product of hell? Feel free to leave me a comment.