Does the command line /Include switch have some massive inefficiency?
TheGT
Posts: 4 Bronze 1
in SQL Compare
The /Include switch is meant to reduce the comparison to specific objects. I have a database with thousands of stored procedures, and when I set it to compare only a single stored procedure, it takes over 107 seconds to do the compare. If I use the same command on a database with far fewer objects, it takes a few seconds.
Example command line arguments that take 107 seconds: (the source is a folder with 1 file containing just the specified stored procedure)
.\SQLCompare.exe /scr1:"C:\GitRepos\TempDBScriptsForComparison" /scr2:"C:\GitRepos\MYDB" /Synchronize /IgnoreParserErrors /Options:IgnoreFillFactor,IgnoreWhiteSpace,IgnoreUserProperties,IgnoreWithElementOrder,IgnoreDatabaseAndServerName /Include:StoredProcedure /Include:StoredProcedure:"\[dbo\]\.\[my_stored_proc\]"
The first /Include:StoredProcedure is supposed to make it ignore all other object types
The second /Include:StoredProcedure:[dbo].[my_stored_proc] is supposed to make it only compare that one proc
While the compare ultimately works, the fact that it takes 107 seconds, and that time scales up based on database size, indicates something with the /Include filtering is not working efficiently. The object name is specified so it should take no more than the time it takes to compare the one object definition, clearly it is reading through more/all? the objects on the target which should not be read due to the /Include.
Example command line arguments that take 107 seconds: (the source is a folder with 1 file containing just the specified stored procedure)
.\SQLCompare.exe /scr1:"C:\GitRepos\TempDBScriptsForComparison" /scr2:"C:\GitRepos\MYDB" /Synchronize /IgnoreParserErrors /Options:IgnoreFillFactor,IgnoreWhiteSpace,IgnoreUserProperties,IgnoreWithElementOrder,IgnoreDatabaseAndServerName /Include:StoredProcedure /Include:StoredProcedure:"\[dbo\]\.\[my_stored_proc\]"
The first /Include:StoredProcedure is supposed to make it ignore all other object types
The second /Include:StoredProcedure:[dbo].[my_stored_proc] is supposed to make it only compare that one proc
While the compare ultimately works, the fact that it takes 107 seconds, and that time scales up based on database size, indicates something with the /Include filtering is not working efficiently. The object name is specified so it should take no more than the time it takes to compare the one object definition, clearly it is reading through more/all? the objects on the target which should not be read due to the /Include.
Tagged:
Answers
Product Manager
Redgate Software