-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import-D365Bacpac rebuild index mode #648
Comments
Nice find, thanks. I see no issue adding that, according to https://stackoverflow.com/questions/6309614/what-is-the-difference-between-offline-and-online-index-rebuild-in-sql-server the only drawback of the offline index rebuild is that it causes table locking, which we don't care about during a bacpac import. The first SqlPackage version that supports that property was 18.7 (released on March 10, 2021). I don't think we need to support older versions. We could also think about adding an optional parameter to Import-D365Bacpac that would allow specifying additional properties. It would work similar to the |
It would sense to allow for additional parameter flags to be passed into the cmdlet and for there into the inner cmdlet. I believe we should handle the sane defaults, specify which are part of our implementation and let people run with their own special needs from there. |
@Splaxi it is up to you how to maintain this, but I suggest keeping it simple. Import-D365Bacpac purpose is to restore a backup for D365FO databases. I suggest to set up default parameters that are most optimal for this one particular task. If someone has particular needs, they can run SQLPackage directly without this tooling. |
@Splaxi did several more tests for small and medium datafiles So it will be great to have some option for these 2 parameters full command: |
Should any one of the mentioned parameters be defaults? |
I suggest the following - /p:DisableIndexesForDataPhase=FALSE - it is up to you, maybe set a parameter for this. In all cases that I tested this gives some perf boost. but maybe on a large dataset, it may be slower |
Enables power users of the cmdlet to provide a list of properties to be used by SQLPackage to customize the bacpac import. d365collaborative#648
I created #760 to essentially expose the This would enable bacpac imports like this: [System.Collections.ArrayList] $PropertiesList = New-Object -TypeName "System.Collections.ArrayList"
$PropertiesList.Add("RebuildIndexesOfflineForDataPhase=true")
$PropertiesList.Add("DisableIndexesForDataPhase=false")
$Params = @{
BacpacFile = "C:\Temp\d365fo.tools\AxDB.bacpac"
ImportModeTier1 = $true
NewDatabaseName = "GOLDEN"
Properties = $PropertiesList.ToArray()
}
Import-D365Bacpac @Params This enables testing of bacpac imports with user provided properties for SQLPackage.exe. |
0.7.2 is on its way. Take it for a spin! |
Hi. Currently Import-D365Bacpac procedure using SQLPackage util with default parameters. So at the end of procedure, all indexes are rebuilt using an Online switch:
ALTER INDEX [I_14937RECID] ON [dbo].[INVENTTRANS] REBUILD WITH ( ONLINE = ON , DATA_COMPRESSION = PAGE )
In the latest SQLPackage version Microsoft added a switch to improve this behaviour:
https://docs.microsoft.com/en-us/sql/tools/sqlpackage/troubleshooting-import-export-sqlpackage?view=sql-server-ver15#import-action-tips
it is possible to add the following switch by default? online rebuild is quite slow compared to offline
"/p:RebuildIndexesOfflineForDataPhase=True "
The text was updated successfully, but these errors were encountered: