Percentage is inaccurate while registering/comparing db?
steveschoon
Posts: 8
I'm comparing a small snapshot (4-6 tables) to a larger database (40-50 tables) using a C# app and the toolkit. It is working fine, except for the fact that the percent complete appears to be inaccurate.
Writing everything to the debug window in VS.NET during the compare generates this output:
Percentage: 0 Message: Connecting to server
Percentage: -1 Message: Reading full text information
Percentage: -1 Message: Reading object names
Percentage: -1 Message: Reading tables
Percentage: 1 Message:
Percentage: -1 Message: Reading object text
Percentage: 2 Message:
Percentage: 3 Message:
Percentage: 4 Message:
Percentage: 5 Message:
Percentage: 6 Message:
Percentage: 7 Message:
Percentage: 8 Message:
Percentage: 9 Message:
Percentage: 10 Message:
Percentage: 11 Message:
Percentage: 12 Message:
Percentage: 13 Message:
Percentage: -1 Message: Reading defaults
Percentage: -1 Message: Reading rules
Percentage: -1 Message: Reading user defined types
Percentage: -1 Message: Reading columns
Percentage: 14 Message:
Percentage: 15 Message:
Percentage: 16 Message:
Percentage: 17 Message:
Percentage: 18 Message:
Percentage: 19 Message:
Percentage: 20 Message:
Percentage: 21 Message:
Percentage: 22 Message:
Percentage: 23 Message:
Percentage: 24 Message:
Percentage: 25 Message:
Percentage: 26 Message:
Percentage: -1 Message: Reading views
Percentage: -1 Message: Reading stored procedures
Percentage: 27 Message:
Percentage: 28 Message:
Percentage: 29 Message:
Percentage: 30 Message:
Percentage: 31 Message:
Percentage: 32 Message:
Percentage: 33 Message:
Percentage: 34 Message:
Percentage: 35 Message:
Percentage: 36 Message:
Percentage: -1 Message: Reading indexes
Percentage: 37 Message:
Percentage: 38 Message:
Percentage: 39 Message:
Percentage: -1 Message: Reading foreign keys
Percentage: -1 Message: Reading constraints
Percentage: -1 Message: Reading triggers
Percentage: 40 Message:
Percentage: -1 Message: Reading functions
Percentage: -1 Message: Reading UDT dependencies
Percentage: -1 Message: Reading users
Percentage: -1 Message: Reading roles
Percentage: 41 Message:
Percentage: -1 Message: Reading permissions
Percentage: -1 Message: Calculating dependencies
And then it's all done. I was expecting to see it up to 99 or 100...
Any ideas?
Writing everything to the debug window in VS.NET during the compare generates this output:
Percentage: 0 Message: Connecting to server
Percentage: -1 Message: Reading full text information
Percentage: -1 Message: Reading object names
Percentage: -1 Message: Reading tables
Percentage: 1 Message:
Percentage: -1 Message: Reading object text
Percentage: 2 Message:
Percentage: 3 Message:
Percentage: 4 Message:
Percentage: 5 Message:
Percentage: 6 Message:
Percentage: 7 Message:
Percentage: 8 Message:
Percentage: 9 Message:
Percentage: 10 Message:
Percentage: 11 Message:
Percentage: 12 Message:
Percentage: 13 Message:
Percentage: -1 Message: Reading defaults
Percentage: -1 Message: Reading rules
Percentage: -1 Message: Reading user defined types
Percentage: -1 Message: Reading columns
Percentage: 14 Message:
Percentage: 15 Message:
Percentage: 16 Message:
Percentage: 17 Message:
Percentage: 18 Message:
Percentage: 19 Message:
Percentage: 20 Message:
Percentage: 21 Message:
Percentage: 22 Message:
Percentage: 23 Message:
Percentage: 24 Message:
Percentage: 25 Message:
Percentage: 26 Message:
Percentage: -1 Message: Reading views
Percentage: -1 Message: Reading stored procedures
Percentage: 27 Message:
Percentage: 28 Message:
Percentage: 29 Message:
Percentage: 30 Message:
Percentage: 31 Message:
Percentage: 32 Message:
Percentage: 33 Message:
Percentage: 34 Message:
Percentage: 35 Message:
Percentage: 36 Message:
Percentage: -1 Message: Reading indexes
Percentage: 37 Message:
Percentage: 38 Message:
Percentage: 39 Message:
Percentage: -1 Message: Reading foreign keys
Percentage: -1 Message: Reading constraints
Percentage: -1 Message: Reading triggers
Percentage: 40 Message:
Percentage: -1 Message: Reading functions
Percentage: -1 Message: Reading UDT dependencies
Percentage: -1 Message: Reading users
Percentage: -1 Message: Reading roles
Percentage: 41 Message:
Percentage: -1 Message: Reading permissions
Percentage: -1 Message: Calculating dependencies
And then it's all done. I was expecting to see it up to 99 or 100...
Any ideas?
Steve Schoon
Comments
I'd make an assumption that the reason for the progress dialogue skipping from 41 percent to completed is because you're comparing a snapshot. Calculating dependencies is already done inside the snapshot.
Do you get the same problem comparing two live data sources?
Here's what the code looks like:
label1.Text = "Registering target database";
label1.Update();
Database liveDb = new Database();
liveDb.Status += new StatusEventHandler(OnStatus);
ConnectionProperties props = new ConnectionProperties("VMS0159", "marketplace", "sa", "");
liveDb.Register(props, Options.Default);
// when I get here, % complete is 41%
label1.Text = "Registering source database";
label1.Update();
Database s3dataDb = new Database();
s3dataDb.Status += new StatusEventHandler(OnStatus);
s3dataDb.LoadFromDisk(@\s3data.snp);
I haven't got around to looking at this again because I was under the impression that it was working okay, based on what you'd said. I'll have a look at it tomorrow morning and see how the StatusEventHandler is supposed to report the comparison progress.
I agree that this doesn't seem to be completely right. On my tests, I normally get up to 56% progress on Database.Register() ,then it's all done! I can only assume that when this was written, calculating dependencies took much, much longer and the statuseventhandler doesn't seem to reflect the speed increase.
I'll raise this as an issue and see if we can get it fixed.
Thanks for pointing it out.