Forum Discussion
Defragment not working
I'm glad to hear you've made progress - pushing transforms as far upstream as possible is always a good thing.
Regarding your calculated columns, and DAX expression that uses FILTER() on a whole table always carries a risk of a memory spike. How many rows are in the FollowUps table? It could be that an expression something like this would be better from the point of view of memory:
Response(patient contact)_=
var CurrentInspectionId = SELECTEDVALUE(FollowUps[InspectionId])
return
CALCULATE(
MAX(FollowUps[Response]),
FollowUps[InspectionId] = CurrentInspectionId,
FollowUps[QuestionId] = "973")Apologies for any typos/syntax errors, or if this is exactly what you had before you optimised.
I don't think there's a way of identifying how much memory each calculated column in a table uses during a refresh, so it will have to be a process of elimination - you'll need to add each calculated column individually, refresh and see how the memory usage is affected.
Hi and thank you again, cpwebb . I've continued working on this and managed to create a view of the table that previously had a query folding issue in SQL Server. Also we have 2 large tables, each containing around 9 million rows, where I've transferred almost all of the calculated columns for these tables into SQL server. Also adjusted the maximum parallelisim in PBI desktop to 3 and 1 before publishing.
Eventually, the PeakMemory dropped to around 3.4GB-3.6GB, but the refreshes still fail.
It's quite confusing, as I'm not sure where to look next.
Here are some findings from my tests:
1- When I define incremental refresh policy and publish the dataset, the first refresh, which creates the partitions, succeeds (tested multiple times), but subsequent refreshes fails.
2- Without defining an incremental refresh policy, the first refresh fails.
3- The CPU Time for the 2 large tables is 229000 and 103000. Even the manual refresh in PBI desktop for these 2 tables takes a considerable amount of time to complete.
4- Refreshed each table in SSMS and checked the profiler. We have 2 Fact tables, one with 300K rows and PeakMemory of 1.95GB and the other one with 9 million rows and PeakMemory of 2.9GB. There are 2 other child tables with PeakMemory of 1.7GB and 1.3GB and the remaining tables are around 200 MB.
5- Any time I publish the semantic model to PBI service, I observe the dictionary size for the ID columns of the 2 large tables is very big and I have to do the defragment, which sometimes works and reduces the size of dictionary and sometimes doesn't work.
Additionally, I would like to know if it's possible to refresh the tables sequentially in PBI service? Does defining maximum parallelism (let's say to one) affect the tables, or is it only for the partitions?
I've created a Powershell query in Azure Runbooks to refresh the tables, but defining "maxParallelism" is resulting in an error (perhaps I'm not defining it correctly).
Thanks again, your ideas and comments are really really appreciated!