Requested Improvement for SQL Compare "diff" View

Forum for users of SQL Compare schema synchronization utility

Moderators: JonathanWatts, Chris Auckland, David Atkinson

Requested Improvement for SQL Compare "diff" View

Postby xor88 » Fri Oct 14, 2011 12:21 pm

Please look at this image: Image

The image shows a "diff" of two similar but not identical index structures on a table. Problems:

As you can see, the indexes 1 and 2 are named differently, so they should ne be compared. They should be listed in different lines.

The statistics 3 and 4 are identical. They should end up in the same line with background color white. There is no difference at all.

5 and 6 are the same again. They just happen to be in a different order.

I propose the following change: Match all objects by name first, then only diff objects that are named exactly the same. Do not let the diff engine do a text diff for all objects because as you can see that technique is really really buggy ;-)
xor88
 
Posts: 6
Joined: Fri Sep 26, 2008 9:03 pm

Postby Chris.Allen » Mon Oct 17, 2011 1:31 pm

Thank you - good points, of course. I'll check to see if this is a known issue and try to get an idea of when it might be addressed.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby xor88 » Mon Oct 17, 2011 1:53 pm

Thanks.
xor88
 
Posts: 6
Joined: Fri Sep 26, 2008 9:03 pm

Postby Chris.Allen » Wed Oct 19, 2011 4:13 pm

I chatted with the product experts and they clued me in- the differences that are there and shouldn't be reported are there because what you see is a simple text difference- i.e. this is by design. We do intend to put a little more intelligence in the algorithm but we are trying to gauge if the trade off (in terms of time) is acceptable.

The differences that are not there that are reported are because, when flagging a block of differences, Compare doesn't always notice that there is an identical line- but in a different place. Perfect comparisons are a hard problem (winmerge, 'beyond compare' etc all suffer the same problem ). I believe Compare tries to re-order statements to minimise flagged differences but it cannot do this for all lines.

In summary- this behaviour is all by design but we recognise it could be better and the products continue to evolve.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby xor88 » Wed Nov 02, 2011 1:58 am

Hey Chris,

thanks for the explanation. I fully understand the issue.

I propose a workaround: Match all objects by name into pairs, then let the text diff engine run only on pairs of identically named objects. Then concatenate the individual diffs to one big diff which will now show up correctly. This approach requires only little code changes, certainly no rewrite of the diff engine or the text display component.

This approach also removes the need to reordering, which, as you stated, does not always work in case of insertions and deletions.

Finally, as a motivation to implement this: When using big tables you cannot always just execute the synchronization. Instead you have to cherry-pick the changes and apply only those which can run online or are very fast. Cherry-picking is currently very cumbersome, it would be trivial with a working diff.
xor88
 
Posts: 6
Joined: Fri Sep 26, 2008 9:03 pm

Postby xor88 » Thu Nov 03, 2011 7:05 pm

Now that I think about it, this is not a workaround. Imho, this is the optimal solution.
xor88
 
Posts: 6
Joined: Fri Sep 26, 2008 9:03 pm


Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests