Database.Register taking a long time

Bruno.LatteBruno.Latte Posts: 8
edited April 24, 2015 6:58AM in SQL Comparison SDK 11
Hello,

When I register our database (+- 400 tables), using the Register() method with default options, it takes a long time ( > 100000 ms or time to get some coffee).
Comparing a DB to a snapshot takes +- 10000 ms. That's not as long, but still quit some time.
Is there any way we can speed this up? Maybe use different options?

Grtz,
B

Comments

  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post and apologies for the delay in getting back to you.

    I was just wondering how long does it take when you use SQL Compare UI?

    Does the time it takes to complete the action increases or decreases?

    Please let us know how it goes.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • The SQL Compare UI is much, much faster. Only taking +-2 sec. until comparison is complete.
    That's why I think there is something I'm supposed to use as an option or so in the Register() method.

    Here's the basic code I use:
    RedGate.SQLCompare.Engine.Database ProductionDatabase = new RedGate.SQLCompare.Engine.DataBase( );
    System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection( "connectionString" );
    System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder = new System.Data.SqlClient.SqlConnectionStringBuilder( connection.ConnectionString );
    RedGate.SQLCompare.Engine.ConnectionProperties connectionProperties = new RedGate.SQLCompare.Engine.ConnectionProperties( connection.DataSource, connection.Database );
    ProductionDatabase.Register( connectionProperties, Options.Default.Plus( Options.ForceColumnOrder ) );
    

    and the references I added to the project:
      RedGate.Shared.ComparisonInterfaces RedGate.Shared.SQL RedGate.SQLCompare.Engine RedGate.Shared.Utils
  • Have you gotten this working? We are experiencing exactly the same thing. We can run the GUI and it registers and compares in a couple minutes, however calling the RegisterForDataCompare it spins for 10 minutes plus and never comes back.
  • Unfortunately not. I was kind of hoping the Red Gate guys could shed some light on this issue.
  • I'm experiencing the same thing. I have a large number of tables in my database. Using the SDK, registering takes about 15-20 minutes per database, so to register 2 databases (so that I can compare them) takes twice that long - 30-40 minutes. Using the SQL Compare UI, registering databases takes maybe 5-10 seconds per database.

    When doing the actual comparison, the SQL Compare UI is able to compare the databases in about 2-3 minutes. The SDK takes about 15 minutes for the comparison.

    For both the UI and the SDK tests, I'm using the same 2 databases running locally on a development SQL Server. I have exclusive access to the machine and to the SQL Server.

    Any idea why registration and comparison of databases takes so much longer in the SDK than in the UI?
  • ssauberssauber Posts: 1 New member
    I would like to +1 this question, that I would like an answer to. The UI for my database takes around 5 seconds, using the SDK it takes around 2 minutes. I've tried playing with the Options, but haven't found one that works. Apparently the UI for SQL Compare is using different logic than the SDK?

    My code looks like this:
    var liveDb = new Database();
    var testDb = new Database();
    liveServiceDb.RegisterForDataCompare(new ConnectionProperties("Server", "DBName"), Options.Default);
    
  • One problem we've seen is registration taking a lot more time while debugging - is it still slow when running without debugging?

    (I believe one of the reasons for this is that the debugger slows down exception handling a lot, since it has to stop the world and check if it needs to break on each exception)
Sign In or Register to comment.